(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Children's Library | Biodiversity Heritage Library | Additional Collections
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "68 Micro Journal Volume 12 Number 01"

A-relrnki A S13O0 


NewZealand NZ$19 70 


angapora s J2990 


Hong Kong H MS 00 


Malaysia M JS8 5» 


Sw»i»Bn 60-SEK 





An in-depth examination of 
the OS-9 design philosophy 

Detailed discussion of Kernel 
operation and real-time 
features 

Sample file manager and 
driver source listings 

Information on customizing 
your OS-9 system 

An invaluable tutorial for the 
professional programmer 



'This bmik was written for programmers 
who would like to use the advanced fea- 
tures of OS-9. It explains and illustrates 
features of OS-9 ranging from memory 
management through file managers" 

—Peter Dibble 



This is a "must" book for 
all serious OS-9 programmers! 



Use this handy order form 



Name 

Address , 

City 

State 



Zip 



Please send me copy(s) of OS-9 Insights at 

$40. (X) each. Add $2.00 shipping and handling for 
each copy ordered. 

TOTAL (includes shipping) $ 



Fill in all the information on this order form. Mail the 
completed order form along with your check, money 
order (no cash, please) or credit card information to: 



MKROWARE SYSTEMS CORPORATION 

1400 N. W. 1 14th Strtvl • IX«s Moines, low.i 50322 

Attention: Order IVpurtmmit 

Or Call: 515-224-192'* 

Civdit c.rnl customers must iximpleto the following: 
(Chtik Ony) 

□ MasterCard □ VISA 

Credit Card # 

Expiration Date 






Signature 

(Rti|uin\i — Crixlil tarxl CiisI.hihts llnJv) 



DON'T DELAY — ORDER TODAY! 



MutUng-020 Muatang-06 Bcnchm&xka 



]BMAT7300Xa>uSya3 

AT&T 7J00 UNK PCCWia 

DEC VAX ll/IMUNIX n»U<7 4 1 

oecvAX umo • 

IMXM OS 9 6HK I .vttu 

M000 OS» UK 10 Mhl 

MVSTAKG -Of MOM OS. 9 «J« /» Mlu 

KlISRWWmK G3-* UI M MAt 

MU£TAA'<;-aMtMWMC«M>« VmiFIMX ttMkz 



■c*islri lone, i 

fas d^r. i < 



gstlmauHl MIPS Ml/CTAM;<KO_ 4.3 MIPS, 
>»m>l. 10 MIPS: vk.to.ot. Saw 



Nil 


(jet** 


9-7 




7.2 


U 


3.6 


32 


5.1 


i2 


HXI 


•HO 


di 


4j0 


»J 


«J 


11 


».«* 


u 


/JJ 



OS-V 

OS? Prubxaul V« 

■tacludsiCCunvilir 

r)aak09 

CCrapiln 

eWOO Disassembler (•/■uuiw sdd J10OOO) 

Kunran77 

Miu u« are l"sscal 

Ottccaauft Psssal 

Slylo Gfii|4i 

SlylD-SpsG 

Sly d-Mcra* 

Slji*(»H*>Spctl.Mer«o 

PAT -art's 

RlSTw/Ca 

CAT/lltST Combo 

Sculpui. (as bel"») 

COM 



tnll-XKX 



Dn»_£X <eao» «») 

Soeea ti&us 
Son Mrs* 
BASIOffcCji^to 
CCaspQa 
COBOL 
CMODKM rh 
TMOM-M .ft 
XTAUK«»Ad) 



Kejtran?? 
Sculp"*- fas below) 

Suniod MLSTANO 02D~ itupfed 111 Mh* 
Addf*. I6*MM«W» 
Add fa I6.6M1UCSW1 
Add d« 30 MhiWOaW AM 



383000 
430 0(1 

soooo 

1 00 00 
730 00 
500 00 
900.00 
49300 
195 00 
175 00 
693.00 
129.00 
79.91 

;w9S0 

99300 
12300 



343OA0 

\ioao 

200.00 
50000 
33000 

710.00 

ioooo 

100.00 

9995 

50J» 

4 JO 00 

995.00 



373 00 
375 at 

730 00 




l6Po.i««pKS02 333.00 

Haaaiiesl » J Aoaj«i» C#da (*)„. Jts.232 Ad.pser 163 00 

fiacb card suppers* addiliunal aaa puns 
(loul of 36 ni<l P"U HW*^! 



60 list l>arsllel I/O cud 
Uses ) M230 liser Issc/Tlmta ships. 
6 pap off luzs each, fcpslae buffet 
direction contra) ft* each ffuup 

Ptewtypt Board 

whIb both dei And KiA devices dt s 

p«e.*il*dnw»vy trca uptu5l?JC UKAVt 



3W00 



7SjOO 



SBC- AX 

snScrfssebci 

AUCNET 

LAN' nftwri drivers 



& the lysuasi and 
■noddled taker* psastns. l-AN, ribct optics aunl 



-call 
l»fl0 



r i f i rt - i T^nniiii m 1 1 n J193XO 

Spscul foi aomfdele MUSTANCW7HF* i|«m buyers - Sculptor* 

J«930aS AVI: 130000 

Soflwirt 



All MVSTANG-020™* syetsrji snd buurdbu yen are eatjuod to 
d WCT jiuai iU lifted software 10-70% dEpcndAf od bebl Otter 

write tor ourace piass^nra «pf«y she* the tela ss well 



Mustang Specifications 

12.5 Mhxf.opuaui 16.6 Mhl available) MC68020 full 32-bit wide p>ili 

32- bit wide data and address tasee. non-rnuluptckcd 

oo chip uiocvaun cache 

object code, ccrnpftublc with all 68XXX family proceuoa 

cnKjAOOd trsOrwCUasn Set - mslh Co- p»uc»* or interface 

68881 math lit -speed floating point cet-prDmanr <optuxu|) 

dunct exlcnuon of full 68020 wutiuctioa Kt 

full nippon IE£l: P7S4. draJl 10 

tnnt£0idkmil wd other caencifu: iruth funcuara 

2Megibyleaf SIPKAM #12 > 32 Bit org.nn.uoo) 

up to 256K bjta of KIKOM (6d « 32 biu) 

d Akynchionaiu icnil 1A) port* sundird 

apuoniJ to 20 tcnal port* 

»und«i<l RS 232 tntctftcc 

optional nciwofk oiterfice 

bufTcred 8 bll parallel port (1/2 MC68230) 

Centronics type puuwl 

cxpannon connector for I/O devices 

16b:t data path 

2S6 byte addrcaaapace 

2 interrupt inpti la 

cluck and coiiuol atgn^la 

Mouxola I/O ChaAncI Modules 

tunc of day clock/calejtdar w/baucry backup 

controller for 2. 5 1/4" floppy dialt drive* 

single or double side. sutgJc or dotible density 

35 to 80 track selectable (4896 Til) 

SASI interface 

programmable pcnudic uilcrrupt generator 

interrupt rale from micro- seconds to seconds 

highly accurate time base (5 PPM) 

5 bit sense switch, readable by the CfV 

Hardware single- step capability 

TVs© hi. speed 68020 systems arc presently working at NASA. Atomic Energy Commission. 
Government Agencies ma well aa Universities, rtusincts. Lab*, and odler Critical Applications 
Centers, worldwide, where speed, math crunching attd mulu-user.mutii tasking UNTX C level 
V com pa Lability and low ccit i* a mutt 




Don't be mislead! 

ONLY Dala-Comp 

delivers (he Super 

MVSTANG.B2Q 



Only the "PRO" Version 
of OS-f Supported! 




This is HEAVY DUTY 

Country! 



ri or a ilmliod lime we. wli oNsr a 1400 utdcHn on yourl 
Old 58aKX SBC Mutt be wortuno propwly »nd ' 
Lcomp)4i0 wrttr aJ aofnvani. cablat and dccumsNtralion . 
CM lot mora) ir«orr<*uon 



l*rice l.Lst: 






Miuung-020 SUC 




5X90 00 


Cabinet wrswitching PS 




S299 95 


5 - -80 track floppy DS/T1D 




S269 95 


Floppy Cable 




S39 95 


OS-9 68 K Profcuionsll Vcrmon 




S850 00 


C Compiler ($500 Value) 




NrC 


Winchester Cable 




S39 95 


Winchester Dnve 25 Mbyte 




S895 00 


Hard Disk Controller 




$395 00 


ShtppuigUSA LI'S 




$20.00 


UniHi-:X 


Less 


$100 00 


MC68881 f/p maili processor 


Add 


$275.00 


1667 Mb/ MC68020 




$375.00 


16.67 Mhi MC6888! 




$37500 


20 Mhi MC68020 Sys 




$750(10 


Note all 68(8 1 dupe work with 20 Mhr Sys 






Total' 


$5299 80 



NEW LOWER PRICES 

25 Mbyte HD S32993C $3749.80 
85 Mbyte HD $534&STI $4548.80 



Note: Only Professional OS-9 Now Available 
(68020 Version) Inclu-cs ($510) C Compiler - 
68020 & 68881 Supported - For UPGRADES 
Wrilc or Call for Professional •S-9 Upgrade Kit 



r 



Data-Comp Division 

C •• < ^^Bi^^ Sy V A r>eca(le °^ Quality S^rvtco" 

/^iJ^Pf^ Systems World Wide 
Compu.er Publishing, Inc. 5900 Cassandra Smith Road 
TekSphone (615)842-4601 - FAX (615) 842-7990 H ' XSOn ' Tn37343 



68 Micro Journal 



Jan. /Feb. '90 



A Member of the CPI Family 



68 Micro 
Journal 




10 Years of Dedication to Motorola CPU Users 

The Originator of "DeskTop Publishing™" 

6800 6809 68000 68010 68020 

Publisher 

Don Williams Sr. 

Executive Editor 
Larry Williams 

Production Manager 
Jeffrey H. Walker 

Office Manager 

Tom Williams 

Subscriptions 

Carolyn Williams 

Contributing & Associate Editors 

Ron Anderson Dr. E.M. "Bud" Pass 

Ron Voigis An Wcllcr 

Doug Luric Dr. Thco Elbert 

Ed Law & Hundreds More of Us 



Toll Free Subscription Line 1-800 669 6809 


fifSt Subscription Rates 


USA 


1 Year $ 49.00, 2 years $ 79.00. 3 years $ 99.00 


Canada & Mexico, USA funds 


I Year $ 58.00, 2 Years $ 95.00, 3 Years $ 125.00 


Other Countries 


Surface Rates , USA funds 


1 Year $ 6 1.00, 2 Years $ 95.00, 3 Years $ 125.00 


Air Mail Rates, USA funds 


1 Year $ 97.00, 2 Years $ 150.00, 3 Years $ 225.00 



COMPUTER 



PUBLISHING, INC 

"Over a Decade of Service" 



"World ' 





Wide" 

68 MICRO JOURNAL 

Computer Publishing Center 

5900 Cassandra Smith Road 

Hixson.TN 37343 
Phone (615) 842-4600 KAX (615) 842-4607 

Copyrighted © 1987 by Computer Publishing, Inc. 
68 Micro Journal is the original" DeskTop Publishing" product 
and has been continously published since 1978 using only 
microcomputers and special "DeskTop" software. Using first a 
kit built680O micro-computer, a modified "ball" typewriter, and 
"home grown" DeskTop Publishing software. There were no 
commercially available DTP packages! Today 68 MicroJoumal 
is acknowledged as the "Grandlalher"of "DeskTop Publishing" 
technology. 



68 MicroJoumal (ISSN 0194-5025) is published I2timcsaycar 
by Computer Publishing Inc. Second Class Postage paid at 
Hixson. TN. and additional entries. POSTMASTER: send 
address changes to 68 Micro Journal, POB 849, Hixson, TN 

37343. 

Items or Articles for Publication 



Articles submitted for publication must include authors name, 
address, telephone numbc r, date and a statement that the material 
is original and the property of the author. Articles submitted 
should be on diskette. OS-9,SK*DOS, FLEX, Macintosh orMS- 
DOS. All printed items should be dark type and satisfactory for 
photo-reproduction. Diagrams arc acceptable, but please no 
hand written articles or blue ink. 

Please - do not format with spaces any text indents, charts, etc. 
(source listing o.k.). We will edit in all formatting. Text should 
fall flush left and use a carriage return only to indicate a 
paragraph end. Please write for free authors guide. 

Letters & Advertising Copy 

Letters to the Editor should be the original copy, signed! Letters 
of grip as well as praise arc acceptable. We reserve the right to 
reject any letter or advertising material, for any reason we deem 
advisable. Advertising Rates: Commercial please contact 68 
Micro Journal Advertising Department. Classified advertising 
must be non-commercial. Minimum of SI 5.50 for first 15 words. 
Add $.60 per word thereafter. No classifieds accepted by tele- 
phone. 



Jan./Feb. '90 



68 Micro Journal 




'T.7.«y .%:**; •: 



Jvr/ X*», *i ■ i , i \ • • « * *• ■ "■■Y ** * * ■ s * * ■ ■■ # * 



L< 



features 




r^'cUE OS9 For Personal Computers 

Erich L. Gibbs Ph.D. 

^^^»Are UNIX and OS9 Compatible ? 

^^^^^^^^ Glenn Wood 

PMiH [ M jfGrab Your OS9 Applications Manuals . *^. 

Jan Johansen 

OS9 File Manager Round-Up 

Steven Weller 



Message Passing Protocol 

.1.11. Brand & L. deGraaf 




..Columns & Contributions 

4 .'Editorial Future Goals & Direction 

1 1 C User Notes A Tutorial Scries 

31 Forth Getting Started in FORTH 

■36 ■'.JSS9andtrve Muciittosh. • OS9 Fits Right into the Mac 





f :>J(fi'.s >e 3-7 :.• *.f| ac- VVattfh * ■■.•■.■'-.••."■... Lctra&l Review ': - :'..." ■/ . "'•.'• DM5 



Larry Williams 

Dr. E. M. "Bud" Pass 

R. D. Luric 
PMW: 






<-»c .. f 



68 MICRQJQURNAL 




68 Micro Journal 



JenJFeb. '90 



<32,@©I1 ©TO iSIPlsiffllUMt, 




SCULPTOR 

From the world's oldest 
& largest OS-9 software house! 

CUTS PROGRAMMING TIME UP TO 80% 

6809/68000-68030 Save 90% 

SCULPTOR-a 4GL - Only from S.E. Media at these prices. OS-9 levels one and two (three CIMIX) 6809, 
all 68XXX OS-9 standard systems. Regular SCULPTOR versions 1.4:6. One of if not the most efficient 
and easy to develope DBMS type systems running under OS-9. A system of flexible keyed file access that 
allows extremely fast record and data retrieval, insertion and deletion or other programmed modifica- 
tions. Access by key or in ascending order, very fast. The system provides automatic menu generation, 
compilation and report generation. Practically unlimited custom input format and report formatting. A 
rich set of maintenance and repair utilities. An extremely efficient development environment that cuts 
most programming approximately 80% in development and debugging! Portable, at source level, to MS- 
DOS, UNIX and many other languages and systems. 

Standard Version: 1.14:6 6809 - $1295.00 

68000 $1295.00 

68020 $1990.00 



Due to a "Special One Time" Purchase, We Are 
Making This Savings Offer. Quantities Limited! 
Once this supply is gone the price goes back up! 
System OS-9: 6809/68000-68030 
• Regular $ 12 9 5.00 



~\ 



ONLY 



99.95 



$ 



S.E. MEDIA 

POB 849 5900 Cassandra Smith Road 

HIXSON, TN 37343 

Telephone<615) 842-4601 FAX (615)842-7990 



WE - WHILE SUPPLIES LAST! 




J an. /Feb. '90 



68 M»o Journal 



68 



Micro Journal 

Editorial 



Welcome to the 1990's 

From the Desk of Larry E. Williams 



The staff and management of 68 
Micro Journal hopes thai all of you en- 
joyed a happy new year and that next 
year will be a most prosperous year 
for each of you. It's been a very fast 
pace for us here at 68 Micro Journal in 
the last quarter of 1989, and I'd like to 
use a few lines here to bring you up on 
all the exciting changes 68 Micro 
Journal his and will be taking. 

68 Micro Journal is now an OS9 
Systems Integration Magazine. We 
have spent many hours of consultation 
with various groups includ- 
ing developers, design engi- 
neers, researchers and others 
to determine the best 
possible target group for 68 
Micro Journal to focus on. 
The overwhelming response 
was to highlight OS9 the 
operating system because of its exten- 
sive penetration into several promising 
markets that arc keys to the growth of 
Motorola and other chip manufactur- 
ers for the future. The level of 
response to 68 Micro Journal in Eu- 
ropcovcr the past year has been testa- 
ment to that. There has been many re- 
quests from overseas that 68 Micro 
Journal has not been positioned to 
properly icspond to. This change of 
direction was made with input from 
many sources, both domestic and 
overseas. 

With the AugVScpt. 1989 issue we 
took the first step in bringing to the 
magazine, articles that were of interest 
to a greater number of our new sub- 
scribers and older ones as well. We 
warmly welcome input from our 
subscribers as well as others. We 
encourage you to write or call and tell 
us what you feel would be the best 
subject matter for future articles. We 
hope these changes will be beneficial 



to our readers as well as our advcitis- 
crs. 

With all the changes we were 
making over the past few months it 
was not possible to publish each 
month. It is our goal to be again 
publishing monthly beginning with the 
May 1990 issue. Subscription labels 
with the March/April issue will 
indicate the adjustment in your 
expiration date. The subscription rate 
that you paid was for 12 issues and 



"World 




therefore all cxpiiation dates will 
reflect some changes since we had 2 
combined issues in 1989 and will have 
two in 1990 and we did not publish an 
OcL.Nov. or Dec 1989 issue. 

The changes you see in the yearly 
subscription rates have taken place for 
several reasons. 68 Micro Journal will 
pay for OS9 articles. Articles submit- 
ted for pay must be clearly marked as 
such and submitted on an OS9 
formatted disk. Write or call for an au- 
thors guideline sheet if you arc 
interested. These changes are neces- 
sary to allow 68 Micro Journal to 
remain as the professional OS9 users 
magazine. 

OS9 is clearly a leader in real lime 
operating systems around the world 
today, and for that reason 68 Micro 
Journal will keep step to bring its 
readers a higher level of useful articles 
and information for the OS9 market 
place. The past decade has been 



exciting and full of changes, and we 
here at 68 Micro Journal are proud to 
have been there as those changes took 
place. 

Since it takes as long as 90 days to 
reach a large number of our overseas 
subscribers, we will accept from over- 
seas subscribers through the month of 
May 1990 subscriptions at the old rate 
of $36.50 per year surface and S72.50 
per year airmail overseas. This 

extension of the old rate will 
only be available to cuiTcnt 
overseas subscribers. 68 Micro 
Journal will accept from 
current USA subscribers the 
old subscription rate of $24 .50 
per year thiough the end of 
February 1990. Take advan- 
tage of this while you can. 

Without ever having received any 
advertising support from Motorola it 
has been difficult to stay committed to 
just being a Motorola magazine. How- 
ever, 68 Micro Journal still feels that 
Motorola makes the best micro- 
processor in the world and we will 
continue so support Motorola in the 
future with coverage. However, as 
OS9 is introduced and developed on 
other platforms 68 Micro Journal will 
be right there covering OS9 as the best 
real-time operating system in the 
world. 

Last but not least we want to thank 
all of you who have loyally hung i n 
there all these years. And, as in the 
past, let us know what you want and 
what you feel we should be doing. 
After all it is still our readers who de- 
termines what we will be. 



66 Micro Journal 



JaiWFeb. '90 



OS-9 for 



PERSONAL 




COMPUTERS 



AN ASSESSMENT 

Sharing information is one of the most 
important functions a computer can pro- 
vide, yet most of the millions of comput- 
ers in the world arc stand-alone, personal 
computers, which support only one user 
at a time. Single-user computers of any 
kind represent an incredible waMc of 
computing potential. With few excep- 
tions, they idle away well over 90% of 
their potential, wailing for users to make 
decisions, or simply wailing between 
keystrokes on the keyboard. A computer 
can accept keyboard entries about 50 
times faucr than anyone can type. No 
one disputes the fact that personal com- 
puters have contributed positively and 
extensively to revolutionizing the way 



man thinks and works: however, the cost 
has been unnecessarily high. Asa result, 
productivity has not been as great as it 
might have been, and the benefits of 
computer technology have not been as 
widely distributed as they might have 
been. Gibbs Laboratories. Inc.. has had 
thcgixxl fortune to be pan of a number of 
high-technology breakthroughs during 
its 50 years of existence; we realize how 
difficult it can be to protect a technology 
from becoming distorted by marketing 
pressures. From our vantage point, we do 
not sec the long term wisdom to flooding 
the market with single-user, strictly 
graphics-oriented computer;; to the ex- 
clusion of multi-user, multi-tasking ca- 
pability. Designers and manufacturers 



SUMMARY 

Worldwide, tens of millions of personal computers are on the 
verge of becoming competitively obsolete and slipping from the 
market, because they lack multi-user, multi-tasking capability. The 
market does not have the capital or sophistication to upgrade more 
than a small percentage of these installations using network technol- 
ogy or by replacement with new, high-performance personal com- 
puters, stuffed with memory. The powerful OS-9 operating system 
is memory efficient, has a high comfort index with software devel- 
opers, and enjoys an excellent reputation for support. OS-9 would 
revolutionize the market, if it could be easily installed into personal 
computers. The Ultrasciencedivison of Gibbs Laboratories, Inc., has 
developed practical, low-cost products for adding OS-9 to IBM-style 
PC/XT/AT and Macintosh computers without the loss of ex isting ap- 
plications, warranties, or support. 



had alternatives: they could have offered 
the market low-cost, multi-user, multi- 
tasking personal computers, which pro- 
vided a little less whizz and a lot more 
hang. 



H 


"This Is an 
exciting lime 
for OS-9. and 
we are thrilled 
to be part of 
If 







Personal computers could have been 
designed to support a graphics monitor 
aft well as serial devices. Bit-mapped 
graphics plays an important, much 
needed, role; however, serial devices 
make more efficient use of computer 
hardware, because they can use com- 
pressed ASCII computer code to transfer 
information. Filling the screen of a se- 
rial, business terminal (often referred to 
as "dumb" video display terminal) re- 
quires transmitting about 20.000 bits of 
data down the data hookup wires. Creat- 
ing exactly the same screen on a standard 
monochrome graphics monitor takes 
about 20 times as many bits. A color 
monitor requires about 200 times as 
many bits. Of all the tasks performed by 
computers, only a relatively small per- 
centage arc really bit-mapped graphics 
dependent. Desktop publishing is graph- 
ics dependent, but word processing is 
not: neither arc spreadsheets, account- 



Jan-'Feb. '90 



68 Micro Journal 



ing, electronic mail, automatic data ac- 
quisition, machine control The mar- 
ket cannot afford to do everything in bit- 
mapped graphics mode: it wants to run 
serial terminals, bar code readers, elec- 
tronic cash registers, business machines, 
instruments, production equipment, and 
a host of other devices in a multi-user, 
multi-tasking environment • inexpen- 
sively! 

A few years ago, our Ultrascicncc di- 
vision took a long, hard look at the per- 
sonal computer market 
and began intensive re- 
search and development 
on products designed to 
adapt personal comput- 
ers to be the practical, 
multi-user, multi-task- 
ing computers they 
could have been in the 
first place. We sensed 
that most of the existing 
personal computer mar- 
ket would never be able 
to bear the cost and com- 
plexity of LANs and 
other solutions which 
require discarding current hardware for 
high-end computers stuffed with mem- 
ory. Productivity/cost ratios of new per- 
sonal computer systems were increasing, 
but so were up-front costs. As a result, 
the sales of each new round of systems 
were forcing a relatively greater number 
of existing systems into non-competitive 
obsolescence. More and more individu- 
als and businesses were discovering that 
they were working to support their com- 
puters, rather than the other way around. 
Our goal was to contribute products 
which would help to reverse this trend 
and increase the learning and earning 
power of people, worldwide. 

THE OS-9 SOLUTION 

Given the scope of the undertaking, 
we had no illusions. If we were lobe suc- 
cessful, we would have todcvclop prod- 
ucts which would take advantage of ex- 
isting market foiccs and the enormously 
complex worldwide supply and support 
structure. We could not redirect the 
market: our products would have to serve 
a catalytic function by removing ob- 
stacles, preventing the market from ac- 
complishing what it wasalrcady inclined 



to do. 

Software is the most expensive com- 
ponent of most computer installations, tt 
would be impossible to persuade a gen- 
eration of personal computer users to 
consider an enhanced approach, if they 
first would have to give up what they 
already had. Our multi-user, multi-task- 
ing products would have to tun in con- 
junction withcxisting personal computer 
software. Also, it would be impossible to 
implement any solution which wouldnot 



PERSONAL COMPUTERS 



70.5 Million Units 




make maximum use of the existing base 
of programming experience and pro- 
gramming tools. There would be neither 
time nor money to extensively retrain 
and retool enough programmers. What 
we needed was a very powerful, multi- 
user, multi-tasking operating system 
which would work efficiently in small 
memory spaces. It would have to be full- 
featured, support the major languages, 
and provide today's programmers with a 
high comfort level and room to grow. 
The operating system would also have to 
be hardware independent, so that soft- 
ware written for personal 
computers could run on 
larger and faster com- 
puters without rcpro- 
gramming. thereby en- 
suring a smooth, practi- 
cal upgrade path. 

The OS-9 operating 
system from Microwarc 
was exactly what we re- 
quired, and more. 
Though not yet a house- 
hold name. OS-9 enjoys 
a well deserved, world- 
wide reputation for per- 



formance, and it is utilized by such in- 
dustry giants as Sony and Philips. The 
computer industiy knows OS-9 as the 
original operating system for the most 
powerful and widely used family of gen- 
eral purpose computer processor chips 
available, the Motorola 68K family. 

OS-9 combines significant new oper- 
ating system concepts and real-time ca- 
pabilities with the overall architecture of 
the popular UNIX operating system: yet, 
the core software for Professional OS-9 
requires only a tiny fraction of the 
memory required for UNIX, less than 
150Kb. Without sacrificing program- 
ming convenience and features, OS-9 
achieves exceptionally fast context 
switching times and interrupt response. 
The versatile memory module design is 
re-entrant and position independent: the 
system requires only one copy of a pro- 
gram, no matter how many people may 
be using that program. OS-9 supports 
arithmetic and I/O coprocessors, graph- 
ics, networking, and standard versions 
of all the major software languages. 
BASIC. C. FORTH. FORTRAN, MOD- 
ULA-2. MUMPS. PASCAL, etc.. and it 
is hardware independent. Powerful sys- 
tem-state, user-state, and language de- 
buggers are available. There is a cornu- 
copia of office automation, data bases, 
and applications available for OS-9 com- 
puters, and the list is growing rapidly. 
OS-9 versions of UNIX tools and utili- 
ties, such as curses and the Bourne Shell. 
are available to make conversion of 
UNIX applications convenient. Curses 
neutralizes the differences between dif- 
ferent brands of tenn inals. so application 
programmers can write standardized 
code for windowing and display en- 



USER SYSTEM 




68 Micro Journal 



JsnJFeb. '90 



PERSONAL COMPUTERS 
MARKET SHARE 




hanccmcnis (i.e. blinking, underline, re- 
verse video, etc.). The Btiurne Shell is a 
powerful command programming lan- 
guage. It can be used lo build individual 
programs. even those wriilcn in differ- 
ent languages, into complex, interac- 
tive, high-level applications. 

The market dictated which per- 
sonal computers we would initially 
support. IBM-style PC/XT/AT (com- 
patible brands and models included) 
and Macintosh computers arc well 
defined standards and. together, they 
represent the lion's share of all those 
computers presently in operation. The 
diversity of third parly products avail- 
able for these computers and the 
strength of their service/support sys- 
tems contributed significantly to their 
success: it was imperative that our 
products install without modification 
of standard, compatible hardware or 
software. In fact, we would have to go 
a step beyond. It would be necessary 
to interface the standard DOS and 
MAC software environment gracefully 
from OS-9: otherwise, it would be im- 
practical to support the wealth of exist- 
ing third parly hardware. 

OS-9 FOR IBM 

Since OS-9 is designed for use with 
the Motorola 68K familyofproccssors.il 
cannot run on the processor chips built 
into IBM-style personal computers. 
Therefore, the Ultrascicncc solution for 
installing OS-9 into IBM-style personal 
computers required designing an inex- 
pensive, but powerful, 68K coprocessor 
board, which would be compatible with 
the PC. XT. or AT hardware and soft- 
ware environment. The PC68K I, as it is 



called, is a complete stand- 
alone 10 or 12.5 MHz 
computer with 1Mb of 
zero wail-state DRAM, 
two efficient, vectored se- 
rial ports, a parallel port. 
battery backed up lime- 
dale chip, and an optional 
battery backed up 8Kb 
sialic RAM (sec specifica- 
tions for details). It com- 
municates with Ihc DOS 
bus by means of a high- 
performance dual polled 
I Kb DRAM. A companion serial expan- 
sion board, ihc M EM IOX. provides up to 
10 more vectored serial ports and addi- 
tional zero wail-slalc DRAM (see speci- 
llcalions for dclails). ThcPC68KI and 



(1989 go*wgi) 



PC68K1 



optional MEM IOX simply plug inlo free 
bus slots in any IBM compatible PC. XT. 
or AT computer (even compatible laptop 
computers have been used). The DOS 
operating system is left undisturbed and 
al I PC/XT/AT dc v ices are accessed from 
OS-9 by means of DOS calls. This 
means lhal OS-9 can support any stan- 
dard. PC/XT/AT compatible third party 
device. Moreover, warranty and support 
for the PC/XT/AT will be unaffected by 
Ihc installation of OS-9. 

Powerful on-board diagnostics, 
which can identify defects down lo spe- 
cific chips, are performed each time the 
PC68KI isresct. Thcdiagnoslic report is 
printed from the first PC68K I serial port . 





An extensive collection of diagnostic 
software tools arc also provided for cases 
of suspected intermittent problems. All 
chips arc socketed, so lhal a PC68K I or 
MEMIOX can be easily repaired, on- 
site or locally, without the need for 
even a soldering iron. 

lnsiallaiionofaPC68Kl and OS- 
9 inlo an existing system usually lakes 
less than an hour. The manual pro- 
vides sicp-by-stcp instructions, which 
arc complemented with plenty of 
serccn grabs and pictures. Firsl. a par- 
tition is added to one or more of ihc 
hard disks. Menu-driven PC68K I sys- 
tem sclup software makes it conven- 
ient lo tailor an OS-9 system for many 
hardware configurations: OS-9 parti- 
tions can be installed on any of up lo 4 
hard disks and any of these partitions 
can be designated as Ihc boot partition. 
Once the OS-9 partitions have been 
designated, the software can be 
loaded. 

A few DOS programs are copied from 
a diskette into a DOS directory on the 



MEMIOX 







Jan ./Feb. '90 



68 Micro Journal 



pcxi coirinmnioH onions 



Cf9 Urr-.lon: XX 

loirl to Pofoult Srtllojis tw 

Hot Xrj: ALT P)B 
Vld« Board Typo AUTO 
Activotr Toskor ^ilih, VB 
Solccl OS-3 Boot Drlvi ^H! 

soi.ci os-s oi-i<« IT; 

Srlrcl OS-9 Orlv« k2: 3 

Sr»«l OS-9 0rlv « , 3: 4 

Uir Buffered Scravn Restart: HO 
CoCfu DPR «ddr: CCW hn 

Aellvtte FerntMl Ports & «nd/or 6: 
Aelltvte Aux Ports <B-1S3 Syslen: J 





UJlr»stlfflc* 
S/R rOWl 



L 



Serl.l I 



•yrlsM 13W Rlcrouin Systems 



as floppy, hard disk, 
and tape drivels), 
with ihc exception 
that unintelligent 
"floppy - " interface 
tape drives have 
proven loo inefficient 
to be practical. 
PC68K1 soil ware dy- 
namically optimizes 
time sharing of DOS 
resources within lim- 
its thai can be set 
manually or under 
program control De- 
scriptors and drivers 
support the Microw- 
arc UV-580, 5807, 
and 5407 57/' disk- 
ette formats and Ihc 
UV-380 and 3807 37 
," diskette formats. 
Data and programs 
can be copied back 
and forth between 
DOS and OS 9. DOS 
programs can be 
spawned from OS-'J 
and live data can be 
passed between OS-'J 
and DOS programs. 



hard disk, using an INSTALL program. 
Mcxl. OS-9 is booted from a diskette, a 
hard disk partition is high-level format- 
ted for OS-9. and the OS-'J soil ware is 
loaded onto Ihc hard disk by means of an 
install program. This completes the in- 
stallation and the PC68K 1 equipped PC/ 
XT/AT is ready lo bool OS-9 and run 
real-lime, multi-user, multitasking ap- 
plications from Ihc monitor and any or all 
of its ports. 

The monitor can be hot-keyed back 
and forth between DOS and OS-'J. while 
OS-'J is runningon from 2 lo 1 2 PC68K 1/ 
MEMIOX serial pons and Ihc PC68K1 
parallel port. An excellent, very full fea- 
tured OS-'J terminal emulating driver 
supports monochrome and color moni- 
tors. When a color monitor is used, pro- 
grams designed for monochrome serial 
terminals will automatically display in 
color without program modifications. 

DOS and OS-9 share PC/XT/AT com- 
palible serial and parallel porl(s) as well 



OS-9KOK MACINTOSH 

Macintosh compulcrs arc designed 
around Motorola68K proccssorchips, so 
we were able lo install OS-'J without the 
need for any hardware. OS-'J and Ihc 
Macintosh operating system oper- 
ate logclher on the same 68K 
processor chip. Since the Macin- 
tosh operating system is lefl un- 
disturbed and Macintosh devices 
arc accessed from OS-9 by means 
of Macintosh Toolbox calls. OS-9 
can support any standard. Macin- 
tosh compatible, third party de- 
vice. Moreover, warranty and 
support for the Macintosh will be 
unaffected by Ihc installation of 
OS-9. 

Installation of OS-'J usually 
lakes less than half an hour. The 
MAC and OS-'J software are pro- 
vided on MAC/800K diskettes. 
To install the software, the user 
creales a folder (directory) called 



"OS" folder" and "drags" (copies) all 
of Ihc diskette files into the folder. Once 
Ihc software is loaded, selecting "OS'J" 
will bool OS-9 and the Macinlosh is 
ready lo run multi-user, multi-tasking 
applications from Ihc monitor and any or 
all of its ports. Battery backed up lime 
and dale arc available lo OS-9 from Ihc 
Macinlosh. OS-9 system setup software 
provides the means to specify the amount 
of memory available for OS-'J and the 
size of up lo 8 OS-9 hard disks, including 
Ihc bootable hard disk. In Ihc Macintosh 
environment. OS-'J "hard disks" are ac- 
tually Macinlosh files. This in no way 
alters the operation of OS-'J: however, it 
does permit OS-9 "hard disks" to be 
backed up with any Macinlosh backup 
device. 

OS-9 supports both color and b/w 
Quick Draw commands for the Macin- 
losh monitor, giving OS-'J for the Macin- 
tosh significant graphics capability. As 
in Ihc case of the IBM implementation of 
OS-'J, there is an excellent, very full 
featured OS-9 terminal emulating driver 
for standard Macinlosh screens and the 
larger add-on color or black and while 
monitors. When a color monitor is used, 
programs designed for monochrome se- 
rial terminals will automatically display 
in color without program modifications. 
The practical limit lo the number of 
users on a Macinlosh. running OS-'J. will 
depend on ihc model. A Mac-Plus is a 
68000 machine, which runs at 8MHz. Ii 
will support a few users. On the other 




68 Micro Journal 



JanJFeb. '90 



* File Edit Uieiu Special 





■ oi9 folder I 


J 
] 


}Jit«n« ;3,7S9Kimn»* I3,6W*k 


OS-9 HO M 

D □ j 

r 


M . K>? 












4 Iri* I4H Win*oi4f* 





(«•%»- >«M It) l*B* l«*V ill* 1*11, I4BR 

1 Bt«r*l i It* 1 1 *«r>* 1 H 
1 iM-Bfit- 1 ' ' ' 1 



end of the spectrum, a Mac. Ilex uses a 
68030 processor running at 16 MHz and 
it will support 15 or more users. A 
number of serial expansion products arc 
available for Macintosh computers. We 
have tested the Hurdler', an intelligent 4 
port serial board forthe Nu- Bus, and per- 
formance was excellent. Adding extra 
OS-9 ports isassimpleasconncctingex- 
pansion hardware and installing driver 
software. 

The capability of running Macintosh 
applications concurrently with OS-9 ap- 
plications is presently under develop- 
ment and is scheduled for release during 
the first quarter of 1990. Support for a 
number of standard Microwarc diskette 
formats, using Macintosh Superdrivc 
compatible disk drives, will be offered at 
the same lime. 



THE UPGRADE 
PATH 

OS-9 for personal 
computers frees the user 
from the expensive 
hardware upgrade path 
normally associated 
with personal comput- 
ers. Many personal 
computer users do not 
realize that VMEbus 
computer systems, us- 
ing high-performance 
68030 processors, arc in 
the same price range as 
fast personal computers, 
yet VMEbus systems 
can support a hundred or 
more serial ports. When 
a more powerful com- 
puter becomes justifi- 
able, everything that 
was invested into the 
OS-9 adapted personal 
computer system can be 
salvaged. Changeover 
could be com- 
pleted in minutes, 
because OS-9 is 
hardware independent and the PC/ 
XT/A Tor Macintosh could be con- 
nected to the larger computer as a 
workstation/terminal. Ultras- 

cience offers DOS and Macintosh 
operating system equivalents of 
the OS-9 terminal emulating driver 
for the monitor. These programs 
make it possible for DOS or Macin- 
tosh computers to hot-key between 
their normal operation and opera- 
tion as a terminal for a computer 
running OS-9. 



••I 



CONCLUSION 

It took a dedicated team of hardware 
and software engineers to design and 
produce practical products, which per- 
mit OS-9 to be installed into IBM-style 
PC/XT/AT and Macintosh personal 
computers. We had our share of false 
starts and blind alleys: however, we are 
confident we have created catalytic 
products which will make multi-user, 
mutli-tasking operation of personal 
computers a practical, and profitable 
reality for both the user and applications 
developer. Our products for installing 
the OS-9 operating system into personal 
computers are easily used and inexpen- 
sive. Users will he able to boost produc- 
tivity without a major capital outlay. 
OS-9 will permit applications program- 
mers to open new markets and rees- 
tablish fading markets with more power- 
ful products that are more easily devel- 
oped and supported. This is an exciting 
lime for OS-9. and we are thrilled to be 
part of it. 



Desktop VMEbus System 




68030 capable of supporting up to 100 poits 



1 Creative Solutions Inc 4701 Randolph Rd.. Suite 
12. Rockville. MD 20852 



OS-9 is a trademark i( Microwarc Systems Corp. 

IBM [so Iradcmaik of IBM Cotp. 

Mac is a trademark of Apple Computer. Inc. 

S/R is a trademark of Ulirascicncc 

UNIX is a trademark of AT&T Bell Laboratories 



FOR THOSE WHO 




10 



Jsn./Feb. '90 



68 MICRO 



JOURNAL 



TM 



60 Micro Journal 




The C Programmers 

Reference Source. 

Always Right On Target! 

C User Notes 



A Tutorial Series 



By: Dr. E. M. Bud' Pass 
1454 Laua Lane N.W. 
Conycrs, GA 30207 
404 483-1717/4570 

Computer Systems Consultants 



INTRODUCTION 

This chapter discusses cypedef declarations 
and provides a comment about real compiler- 
compilers. 

It also poses a problem and provides a file- 
compare program. 

TYPEDEF DEFINITIONS 

The cypedef declaration is one of the lesser- 
used and more misunderstood elements of the 
C language. 

It allows the programmer to create new names 
for existing data types, although il does not 
allow the programmer to create new data 
types. 

In its simplest form, a typedef declaration is 
similar lo a frdefine declaration. 

Thus. 

cypedef inl size; 

may be us«d almost interchangably with 

frdefine size int 

in contexts such as 

sizei.j. k: 

which would be equivalent to 

inl i, j, k; 

except that typedef declarations are local to 
the block in which they are defined and 
^define declarations are global to the source 
file in which they appear, applying to all 
source code physically following them in the 
same compilation. 



More complex typedef declarations are less 
similar to #define declarations, however, 
which may lead to problems of readability. 

Irius. 

typedef inl * size; 

may not be used interchangably with 

#deiine size inl * 

in contexts such as 

size i. j, k; 

since the typedef is equivalent lo 

int *i, *j, »k; 

and not equivalent lo 

inl *i,j. k; 

as implied by the Adeline declaration. 



Following are some examples of the use of 
typedef declarations, as taken from actual 
programs. 

From a Tic-Tac-Toe program: 

cypedef struct 

[ 

int value; /• The move returned by the */ 

int path; I* alphabeia consists of a value */ 

] MOVE; /* and an actual move (path) */ 

/* Alphabeia: lakes a board */ 

MOVE alphabeta(board. whoscmove, alpha. 



beta) 

int boaidf ); /* whose move, alpha Abcla 

cutoffs. */ 

int whosemove; /* and returns a move to 

make and*/ 

int alpha; /* the value that the move has */ 

int beta; 

I 

MOVE result, successor; 

int best_score. i. besl.palh. mademove; 



I 



main() /* The actual game */ 

( 

int i. boardl9]; 

char ch; 

MOVE ourmove; 

( 



I 



From the Dluyslone program: 

typedef enum 
I 

Idenll, Idenl2. Idenl3, ldenl4, IdenlS 
} Enumeration; 

struct Record 

I 

struct Record *PtrComp; 
Enumeration Discr; 
Enumeration EnumComp; 
OneToFifly IntComp; 
char StrtngComp[30); 

I; 

typedef struct Record * RecordPtr; 



68 Mcro Journal 



JanJFeb. '90 



11 



typede f struct Record RecordType; 

RecordPo PtjGIb; 
RecordPu PoGlbNext; 

PoGlbNext = 

(Record Pa )milloc(sizeaf(RecoicTl'ype)); 
PnGIb = 

(ReeordPcr)malloc(sizeaf(RecorcTType)); 
PirClb->PtrComp - PtrClbNext; 
PcrGlb->Discr = ldenil; 
PnGIb->EnumComp = Ideni3; 
PaGlb->InlComp = 40; 
sncpy(PnGlb->SiringComp, "DHRYSTONE 
PROGRAM"); 

Is the following sequence of recursive typedef 
declarations legal with respect 10 either the 
original K A R definiL on of the C language or 
with respect U> the new ANSI standard for the 
C language? 

typedef char byte; 

typedef unsigned byte u_byte; 

The answer is apparently negative in both 
cases, despite the fact that some current 
compilers attempt to accept such syntax. 

One argument against it is that the following 
sequence is not clearly defined by either 
standard: 

typedef iniCpfiX); 
typedef unsigned pfi upfi; 

and because of this ambiguity, it is or should 
be explicitly non-syntactical. 

As a further argument, the following sequence 
of typedef declarations is ambiguous, invalid, 
or both: 

typedef char CHAR; 

typedef unsigned char UCHAR; 

typedef signed char SCHAR; 

typede f unsigned CHAR Char 

typedef unsigned UCHAR UnsignChar; 

typedef unsigned SCHAR SignChar; 

If all of the last three typedefs above are not 
illegal, which are legal and which are illegal? 

It might be much easier on a compiler 10 use 
tile same representation for CHAR and 
SCHAR on a signed char machine, and the 
same representation for CHAR and UCHAR 
on an unsigned char implementation. 

The original set of typedefs could be restated 
as follows: 



typedef signed char byte; 
typedef unsigned char ubyte; 
typedef char utiny; 

As to whether an ANSI-compliant C compiler 
should issue syntax errors on such ambiguous 
declarations, the ANSI C standards 
committee's response would probably be "that 
is a quality of implementation issue". 

Thus, a C compiler which correctly compiles 
conforming source but docs something 
bizarre, such as emitting bad code, for non- 
conforming source could still be called an 
ANSI-compliant C compiler. Despite the best 
efforts of ihe standards committee, there will 
always be ambiguous aspects of ihe C 
language which will be processed differently 
by various C compilers. 

COMPILER -COM PI LERS 

Bob Knighten, of Encore Computer Corpora- 
lion. 257 Cedar Hill Street. Marlborough. 
Maine 02172. (508-460-0500 exl. 2626). 
provided the following comments about 
production compiler-compilers. 

My first was the SolTach ALS Ada compiler 
for the Vax. I worked on this towards the end 
of the implementation phase. This was a 
fairly direct implementation of the technique 
described in Glanville's thesis. Graham was 
actually a consultant during the early design 
stages for this compiler. Glanville didn't 
really address global optimization/register 
allocation issues and the ALS compiler dealt 
with this by doing on-lhe-fly register 
allocation based on lifetime information 
produced by the global optimizer which 
worked on a largely machine independent 
expanded DIANA iree. 

The parser generator was written by a 
SofTech engineer. It was written in Ada, the 
parsers were in Ada and the parser tables were 
Ada aggregates. A minor but important 
change in the language accepted by ihe parser 
(compared to Glanville's design) was to factor 
addressing modes. This was crucial to 
bringing the size of the parse tables for the 
VAX down to merely LARGE. 

This compiler was retargeted to various of the 
Intel microchips (8086. 80286. ?) and to a 
navy computer (AN/UYK-?). The local code 
generation was acceptable, but for the VAX 
and AN/UYK the code quality was poor. The 
reason for this was that the register manage- 
ment scheme really did not work at all well. 
The code quality for the Intel machines was 
fairly good. This was partly because register 
management is just not very important and 



partly because more tuning was done on Ihe 
compilers. 

The SofTech code generator was redesigned 
(by a group headed by me and a colleague) for 
the NIT/DIPS machine. This is a variation 
on the IBM 370 architecture. Instead of using 
the straight LR approach of Graham and 
Glanville, we went to an affix grammar 
approach. This is similar too, but not the 
same as Ganapathi's approach. For this we 
contracted with MetaWare to modify their 
TWS to produce an affix grammar parser. 
The actual language used is described in the 
MetaWare TWS manual (such as it is). It 
shows a notable Ada influence. Again the 
parser tables arc Ada aggregates, and Ihe 
parser skeleton is written in Ada. 

We also changed a number of aspects of the 
code generation/register allocation process. 
The machine description used was not for the 
actual machine, but rather for a similar virtual 
machine having all three operand instructions 
and an infinite supply of all types of registers. 
[In contrast to the IBM machine, the DIPS has 
separate arithmetic and address registers.) 
Following code generation, we then do flow 
analysis, replacement of three operand 
instructions by two operand instructions and 
register binding using a register coloring 
approach. 

I left SofTech before the implementation was 
complete, bul I've been assured by friends 
who are still there thai the quality of code 
generated is quite good. We actually had a 
contractual commitment to produce code 
within some fixed percentage of the execution 
speed of the best hand assembled code for a 
set of benchmarks and we met that goal. 

All of these compilers are quite slow. This 
was primarily because the front end and 
global optimizer are slow, but this just 
allowed the code generator to slip by. These 
arc slow code generators, bul this seems to be 
a reflection that speed was not important 
rather than an inability to be fast, 

The most recent CGG based compiler 1 was 
involved with is the Retargetable Back End at 
Prime Computer. Aspects of that project are 
discussed in two recent papers: 

Prescott K. Turner. "Up-down parsing with 
prefix grammars". SIGPLAN Notices. Vol. 21 
No 12 (Dec. 1986) pp. 167-174 

David Spector and Prescott K. Turner. 
"Limitations of Graham Glanville style code 
generation". SIGPLAN Notices, Vol. 22 No. 2 
(Feb. 1987) pp. 100-108 



12 



Jan./Feb. '90 



68 Micro Journal 



The major change here was lhai Scotl Turner 
came up wilh a different parsing method . I'm 
told thai Wcisgcrbcr and Wilhelm al the 
Univcrsital des Saarlandes have devised a 
similar tree matching code generator. 

Two compilers were built at Prime using this 
technique for code generation. They were 
used internally, but never released due to a 
change in corporate plans, lite speed was not 
good and the code quality was poor. Again 
the local code quality was quite good, but 
nothing was done lake advantage of global 
information. In particular the problem of inte- 
grating register management well had not 
beeii'Solved when the project was cancelled. 

The Inlcrmctrics AlE Ada compiler as being 
based on PQCC technology. Most of the 
recent Imermctrjcs compilers have been 
inspired by the PQCC project and the Ada 
compiler came much closer to using the full 
PQCC approach, but it's probably too strong 
to say it was based on the PQCC technology. 

This also illustrates why the term "Code 
generator generator" is ill-advised. The 
original hope of the PQCC project was to 
largely automate the production of compilers 
using as input language and machine 
specifications. A l Inlcrmctrics a large suite of 
tools have been buiil to help automate the 
building of compilers, but the process has not 
gotten terribly much faster or cheaper. 
Similarly al SofTcch, the reason for going 
wilh the Graham-Glanvjllc technique was to 
produce rctargclablc compilers. But ihc 
process of retargeting these compilers has not 
proved particularly easier than building hand 
crafted code generators from well-defined 
specifications. The reason for this is lhal local 
code selection - ihc part lhal can be done by 
parsing, tree matching, what have you - is nol 
ihc hardest part of code generation, so there 
remains a substantial hand crafted part. 

There arc other production compilers based on 
CCGs: 

Rodney Farrow, "Experience wilh an attribute 
grammar-based compiler" SIGPLAN Notices, 
1982 

This is a report on Intel's Pascal-86 compiler. 

Hans-Sicphan Jansohn, Rudolf Landwchr. 
Jochen Hayek and Michael Thamer, "Generat- 
ing MC68000 code for Ada". SIGPC Notes. 
Vol. 6 No. 2 (1983) pp. 81-87 (1983 ACM 
Conference on Personal and Small Comput- 
ers) 



This is a discussion of Ihc University of 
Karlsruhe Ada compiler which is based on ihc 
GAG (Generator based on Attribute Gram- 
mars) and CGSS (Code Generator Synthesis 
System). Al least the VAX version of this 
compiler is available from a small German 
company, Sysleam A.G. 

John Yates and Robert Schwartz, "Dynamic 
programming and industrial -strength 
instruction selection: Code generation by 
tiring, but nol exhaustive, search", SIGPLAN 
Notices. Vol 23 No. 10 (October 1988) pp. 
131-140 

This describes ihc new code generators being 
used in the Apollo compiler for ihcir new 
RISC machines. It is based on bottom-up tree 
matching and was implemented using LEX, 
YACC and C code. 

Finally I mention that COMPASS has an 
automated code generator production system 
(PEARL?) based on a lexical analysis tech- 
nique. This is discussed in a COMPASS 
technical report by Kathleen Knobc and Joan 
Lukas. 

Based on my experience, bolh direct and 
indirect, I've come to feel lhal ihc value of 
machine generated code generators (or, more 
likely, machine generated code selectors) is in 
providing a framework for generating AND 
MAINTAINING many different compilers. 
And this nol because making one new 
compiler is much faster this way lhan in a less 
automated fashion, but because this enforces a 
discipline and uniformity which is very hard 
io achieve wilhoul automation. 

C PROBLEM 

A reader submitted the following problem. 

/* 

Given a file named lab.dal like the following: 

I II 16 88 22 20 10 
Oil 16 88 22 23 2) 
I 11 16 88 22 23 30 
Oil 16 88 22 23 39 

When 1 do ihc following: 

cc -g filenamc.c 
sdb 



I gel a "doscan.c no such file or directory" 
ciTor from sdb. 



This snippet of code works when I read 

character 

values from ihc file 

(ie: fscanf(fp, "%s %s %s %s %s %s %s". 

cl,c2, c3. c4.c5,c6. c7) 

but ii docs nol work when I try to read integer 
values from the file wilh ihc fscanf in ihc 
code. 

Any ideas why valid integers from a file can't 

be 

read as integers but can be read as char 

strings? 

*/ 

((include <sldio.h> 

main() 
I 

FILE »fp; 
chara(80]; 
inti; 
inl q; 
intr; 
inl s; 
inn; 
inl u; 
inl v; 

fp = fopenCiab.dat". "r"); 
for(i = 0;(i<3); ++i); 
I 

fscanf(fp. "%s %d %d %d %d %d %d". 

a, q, r, s, I, u, v); 

primf("%s %d %d %d 9W %d %<fvn", 

a, q. r. s, I, u, v); 

I 

) 

There arc at least two errors in this program. 

The first should be obvious from ihc com- 
ments, but ihc second is more subtle. 

Since ihc scanf family of functions must 
return values, its arguments must be ad- 
dresses, nol values. This is why char string 
arguments work correctly in the program 
above, but integer arguments do nol work. 
The fscanf function should have been coded 
as the following: 

fscanf(fp, "%s SW %d SW SW %d %d", 



68 Mcro Journal 



J an ./Feb. '90 



13 



». 4q, Ar, As, At, ftu, Av); 

Howevei, when this problem is corrected, the program runs and does 
not encounter an address error, but only reads and outputs the first line 
of the input file. 

The problem is the extra semicolon at the end of the for statement, 
which causes the null statement between the close parenthesis and the 
semicolon to be executed three tunes, but the fscanf-priwf group to be 
executed only once. Thus, this statement should be restated as follows: 

for (i = 0; (i < 3); ++i) 

EXAMPLE C PROGRAM 

Following is this month's example C program: it compares two Tiles. 



I include 
(include 



Otdio . h> 
<ctype . h> 



tifdef IBHPC 
tdefine BINARY "rb" 
tendif 

tifdef SKDOS 
tdefine BINARY "rb" 
tendif 

fifndef BINARY 
tdefine BINARY "r" 
tendif 

FILE «filel; 
FILE »file2; 
char *arg; 
char *prog; 
int base; 
int cl; 
int c2; 
int eflg; 
int lflg - 1; 
long chr; 
long line - 1; 
long akipl ; 
long akip2; 
long v; 

main (argc, argv) 
int argc; 
char "argv; 
( 

prog - argv[0); 
if (argc < 3) 

narg(prog) ; 

arg - argv[l] ; 

if <(arg[0] — '-' ) is (arg[l| — >a')) 

lflg-, argv++, argc— ; 



lflg++. argv++, argc—; 

if (argc !- 3) 

narg (prog) ; 

if <!(filel - fopenfarg - argv[l], BINARY))) 

barg(prog); 

if (!(file2 - fopenfarg - argv(2), BINARY))) 

barg(prcg) ; 

if (argc > 3) 

akipl - otoi (argv [3) ) ; 

if (argc > 4) 

akip2 <• otoi (argv [i] ) ; 

while (akipl) 
{ 

if ((cl - getc(filel)) — EOF) 

arg - argv[l], earg(prog); 
akipl-; 

) 

while (akip2) 

1 

if ((c2 - getc(file2)) — EOF) 

arg - argv[2], earg(prog); 

akip2-; 

} 

for { ; ; ) 

I 

chr++; 

if ((cl - getc(filel)) -- (c2 - getc (file2) ) ) 

) 

if (cl — 'W ) 

line++; 

if (cl — EOF) 

exit<! !eflg) ; 



arg - argv[l]; 

if ((argtOJ — '-•) it (arg[lj 



elae 

{ 

if (!lflg) 



'!')) 



14 



JanJFeb. '90 



68 Micro Journal 



exit(l) ; 

if (cl ~ EOF) 

arg - argvjl], earg(prog); 

if (c2 — EOF) 

oarg (pr°9) ; 

if (lflg — 1) 
1 

printf("%s \a differ: char %ld, line %ld\n", 

argvll], arg, chr, line); 

exit (1) ; 

1 

eflg - 1; 

printf ("%61d Wo %3o\n", chr, cl, c2); 

I 
» 

1 

otoi(s) 
char *s; 

( 

base - 10 - ((»a — '0') « 1); 
for (v - 0; iadigit (»s) ; 

v - (v « base) + (*o++ - '0' ) ) ; 

return (v) ; 

1 

narg(s) 
chsr *s; 

I 

f print f (stderr, "usage: *s [-1) (-s) filel", a); 
fprintf (stderr, * file2 [skipl] [skip2! \n") ; 



exit (2) ; 

I 

barg(a) 
char »s; 

) 

if (lflg) 

fprintf (stderr, "%s; can't open %s\n", s. arg), 

exit (2); 

» 

earg(s) 
char *s; 
( 

fprintf (stderr, *%s: EOF on %s\n", s, arg); 
exit(l) ,- 



FOR THOSE WH 




68 MICRO 

TM 

JOURNAL 



J an. /Feb. '90 



15 



ARE UNIX AND OS-9 

COMPATIBLE? 



By : Glenn Wood. Senior Programmer 
Uttrascience 

A Division ofGibbs Laboratories, Inc. 
Wilmeite, II 



SHELL, YES! 



The rale ai which the Bourne shell 
(Steven R. Bourne) has gained in popu- 
larity and migrated from UNIX, where it 
is the "standard" shell, to other operat- 
ing systems testifies to its usefulness. 
Unlike many shells, which simply exe- 
cute commands sequentially, the Bourne 
shell is a complete command program- 
ming language. It provides the sophisti- 
cation necessary for linking complex and 
diverse programs, perhaps written in 
different languages, into smoothly inte- 
grated software systems with features 
not necessarily present in the individual 
components. Yet, the basics arc so easily 
mastered that it makes an extremely 
friendly programming interface for any 
computer. Ultrascicncc offers the 
Bourne shell as a significant enhance- 
ment to the already rich command set of 
the OS-9 operating system. The Ultras- 
cicncc implementation of the Boumc 
shell for OS-9 is called the "S/R Shell". 
Since both the Boumc shell and the S/R 
Shell have the same features, 1 will refer 
to them together simply as the "shelC. 

Programmers, familiar with shells, 
may ask why Ultrascicncc chose the 
shell and not the slightly more advanced 
"Kom shell" (David Kom) or "C shell" 
(Bill Joy). C shell is known for its inter- 
active features and the Kom shell com- 
bines the interactive fcatuics of the C 
shell with greater efficiency. The decision 



was based on popularity. Because so 
many more people know and use the 
shell, it represents a better value. The 
larger market base translates to better 
support, greater availability of applica- 
tions and qualified programmers, and 
lower purchase price. Most users will 
find the shell to be one of the most useful 
and cost-effective pieces of software 
they can install on their systems. 



...one of the 
most useful and 
coat-effective 
pieces of 
software they 
can Install on 
their systems. 




I can't do justice to the power of the 
shell in a few pages; however, a brief 
review of the highlights should be of 
interest to anyone who is not already 
familiar with it. There arc many excel- 
lent texts which describe the use of the 
shell in detail 1 - 2 - 3 - 4 and technical articles 
abound. The main features of the shell 
can be gioupcd as follows: 



• Script Files and Parameters 

• Variables 

• Block-structured Command 
Language 

• Command substitution 

• Wild-carding 

• Piping and redirection 

• Miscellaneous 

SCRIPT FILES AND 
PARAMETERS 

The OS-9 command to invoke the 
shell is "srshcll". U can be invoked to 
execute a single shell command then 
exit back to the OS-9 shell when it has 
completed its specified task, "srshcll" 
task", or it can be started so that it 
remains active, "srshcll". executing all 
the user's commands un til the user quits 
with an escape. When the shell remains 
active, it will process sequences of shell 
statements entered from a user's key- 
board, or it can process previously cre- 
ated "script files". As their name im- 
plies, script files arc scripts for a se- 
quence of shell statements, and they can 
be created using any text editor. Any 
OS-9 command or shell command (sec 
Table 1) can be used from within the 
shell. Since the shell is a superset of the 
OS-9 shell, it can be installed in place of 
the OS-9 shell. 



16 



Jan./Feto. '90 



68 Micro Journal 



Table 1 - Shell Commands 



No effect: the command docs nothing and returns zero exit sums. 



.Hie 



Read and execute commands from file and return. The search path SPATH is 
used to find the directory containing file, 
break In] 

Exit from the enclosing for or while loop, if any. If n is specified then break 
n levels, 
continue [n] 

Resume the next iteration of the enclosing for or while loop. If n is specified 
then resume at the nth enclosing loop. 
cd [arg] Change the current directory to arg. The shell parameter SHOME is the default 
arg. Also, the shell variable CDPATH is used to search for directories 
conta ning arg. This is fully described in section 4.1.4. 
echo (arg...) 

Echo arguments. See the echo command, 
eval [arg...] 

The arguments arc read as input to the shell and the resulting command(s) 
executed, 
exit In] 

Causes the shell to exit with exit status n. If n is omitted then the exit status 
is that of the lasl command executed. (An end-of-tile will also exit trom the 
shell.) 
export (variable...) 

The given variables arc marked for automatic export to the environment of 
subsequently executed commands. If no arguments arc given then the exported 
variable names arc listed. 
read [variable...] 

•nc line is read from the standard input: successive words of the input arc 
assigned to the variables in order; any remaining words are assigned to the lasl 
variable. The return code is unless an end-of-file is encountered, 
readonly Ivariable...] 

1 Tic value of the given variables may not be changed by subsequent assign- 
ment. If no arguments arc given then a list of all readonly variables is printed, 
return [n] 

Causes a function tp exit with the return value specified by n. If n is omitted, 
the return status is that of the last command executed, 
set 1-uefhkntuvxiarg...)] 

-a Mark variables which arc modified or created for export, 

-c If non- interactive then exit immediately if a command fails, 

-f Disable file name generation. 

h Locale and remember function commands as functions arc defmed. 

-k All keyword arguments arc placed in the environment for a command, 

not only those that precede the command name. 
-n Read commands but do not execute them. 

-t Exit after reading and executing one command, 

-u Treat unset variables as an error when substituting, 

-v Print shell input lines as they arc read, 

-x Print commands and their arguments as they are read. 

Turn off the -x and -v options. 
Using + rather than - causes these flags to be turned off. These flags can also 
be used on invocation of the shell. The setting of flags may be found in S-. 
Remaining arguments to the set command arc assigned, in order, to SI, S2. ... 
If no arguments are given then the values of all names arc printed. 

Table 1 continued on next page 



Script files can accept parameters, just 
as any program would. One class of pata- 
meters, called "positional parameters", 
are passed by listing them after the name 
of the script file. 

inyjtb abc Im wxyz 

Within ihe script file, positional paia- 
melers are designated as SI, 32, S3, ... 
(see Table 2). The script positional paia- 
meters will be replaced by the argu- 
ments in the order they were issued: SI 
is replaced by "abc", 52 is replaced by 
"Im", etc. SO is a special parameter 
which is replaced by the name of the 
script file, "myjob". 

Positional parameters, excluding SO, 
can also be set by using the set command 
from within a script file. The output 
from set will be fed, sequentially, into 
the positional paramters until ihey are 
used up. Thus, "set *" (see Table I) will 
replace Si with the first file name in a 
directory, 52 with the second file name, 
and so on. 

VARIABLES 

The parameters concept is extended 
in the shell to a general purpose system 
of variables (see Table 2). Any word 
proceeded by a $ is interpreted by the 
shell as a variable and the cuuent value 
of that variable is substituted in its place, 
lite value of a variable may be set by a 
simple assignment statement within a 
shell sequence, or it may be passed to a 
script file as a parameter by equaling it 
on the script command line, prior to the 
script name. 

name=Glenn myjob abc Im wxyz ... 

The shell will replace Sname wilh 
Glenn whenever it occurs, unless the 
value of ihe variable is changed as ihe 
shell sequence precedes. 

Variables are very useful for tracking 
and conirolling the operation of the 
computer. In the shell, variables may be 
equated by literal assignment, by pa- 
rameter assignment, by default assign- 
ment, or as arithmetic or string calcula- 
tions based on olher variables (sec Table 
4). 



68 Mcro Journal 



JsnJFeb. '90 



17 



shift In] 



test 



Table 1 • Shell Commands (cont.) 

The positional parameters from $n+l... arc renamed $1... If n is not given, it is 
assumed to be 1. 



Evaluate conditional expressions. Sec the test command. 

trap [arg][nl... 

arg is a command to be read and executed when the shell receives signal(s) n. arg 
is evaluated once when the trap is set and once when the trap is taken. Trap 
commands arc executed in order of signal number. Any attempt to set a trap on 
a signal that was ignored on entry to the current shell is ineffective. An attempt 
to trap on signal ]](mcmory fault) produces an error. If arg is absent then all 
trap(s) n arc reset to their original values. If arg is the null string then this signal 
is ignored by the shell and by invoked commands. If n is then the command arg 
is executed on exit from the shell. Trap with no arguments prints a list of com- 
mands associated with each signal number. 

unset |varlable...| 

For each variable, remove the corresponding variable or function. The variables 
PATH, PS1. PS2, and IFS cannot be unset. 



wait In | 



Wait for the specified process and report its tciminalion status. If n is not given 
then all currently active child processes arc waited for. The return code from this 
command is that of the process waited for. 



Table 2 - Shell Variables 


$? 


The exit status (return code) of 




the last command executed as & 




decimal string. 


$0 


The name of the command pro- 




cedure being executed. 


$# 


The number of positional para- 




meters (in decimal). 


$$ 


The process number of this shell 




(in decimal). 


$! 


The process number of the last 




process run in the background 




(in decimal). 


$• 


The current shell flags, such as 




-x and -v. 


SHOME 




The default argument for the cd 




command. 


SCDPATH 




The list of directories that is 




searched by the cd command. 


$PATH 


A list of directories that contain 




commands (the search path). 


JPS1 


The primacy shell prompt siring, 




by default, S. 


$PS2 


The shell prompts with SPS2 




when further input is needed, by 




default. >. 


sirs 


The set of characters used for 




blank interpretation. 



• name=Glenn 

• bestname=$name 
nextparm=$2 

• bestname=${name-$l} 

• total='expr Stotal ♦ Samount' 

1 he "command subsiiiuiion" feature (sec 
below) even allows the standard output 
text of a piogram to be assigned to a 
variable. 

Variables can be tested and compared 
(sec Table 5). 

• if | Stotal -ge 100 ) then . . . else . 
..fi 

• if | Sbeslname != "" | then . . . 
elif . . . fi 

• while | Scount -ne | do . . . 
done 

Variables also can be passed as a pa- 
rameter to programs or other script files. 

• echo Sbestname 

• dir $1 $2 $3 

• compile Sprogl $prog2 



BLOCK STRUCTURED 
COMMAND LANGUAGE 

The shell command language is 
"block-siructured" which means that 
the commands arc composed of blocks of 
statements. Any block of statements can 
be considered as a single siatcmcnt, so 
blocks can be composed of smaller 
blocks. Each block is structured in one of 
the following forms: 

• A simple command 

• FOR..DO..DONE 

• FOR..IN..DO..DONE 

• WHILE..DO..DONE 

• UNT1L..DO..DONE 

• CASE.. case l..case2..ESAC 

• 1F..THEN..ELSE..FI 

• IF..THEN..ELIF..F1 

These programming constructs can be 
controlled by means of ihc results of 
programs (their 'exit' codes), the values 
of variables and parameters, and the at- 
tributes and ages of files. In fact, by 
utilizing "command substitution" (sec 
below), the standard ouiput text of a 
program can be used to direct subsequent 
operations! 

WILDCARDING 

Wildcarding is a familiar part of 
OS-9. It allows the naming of several 
files by means of a single wild-card 
specification. However, the shell pro- 
vides more powerful wildcarding fea- 
tures, such as single character matches to 
a range of characters and the selection of 
files lhat do NOT match the wild-card 
specification. 

• cat* any file name that 

starts with "cat" 

• [abclxyz any file name begin- 

ning with "a", "b" 
or "c" (upper or 
lower case) and end- 
ing in "*yz". 

• [0-9]* any file name begin- 

ning with a digit. 

• 1*0-9]* any file name NOT 

beginning with a 
digit. 



18 



J an. /Fab. '90 



68 Micro Journal 



Table 3 
Special Shell Characters 

* wildcard maich lo string. 

? wildcard match lo character. 

H wildcard match lo any one of a set 
of characters. 

[•1 wildcard maich lo sequences of 
characters. 

& places commands in background 
mode, leaving the terminal free for 
other tasks 

; separates multiple commands on 
one command line for sequential 
processing 

() groups commands for execution 

\ turns off the meaning of special 
characters such as *, ?. []. 4, ;, >. <. 
and I. 

'...' single quotes turn off the delimit- 
ing meaning of a space and the 
special meaning of all special char- 
acters 

"..." double quotes turn off the delimit- 
ing meaning of a space and the 
special meaning of all special char- 
acters except S and ' 

1> or > 

redirects output of a command into 
a file (replaces existing contents) 

2> redirects error output of a com- 
mand into a file (replaces existing 
contents) 

< redirects input for a command to 
come from a file 

>> redirects output of acommandio be 
added to the end of an existing file 

« here document 

creates a pipe of the output of one 
command to the input of another 
command 

'...' grave accents allow the output of a 
command to be used directly as ar- 
guments on a command line 

$ used with positional parameters 
and user-defined variables 

K comment follows a command to be 
added to the end of an existing file 



COMMAND SUBSTITUTION 

1 have already mentioned command 
substitution several times. It peimits ihe 
standard output from any command lo be 
used as input to shell sequence variables. 
A command, or siring of commands, 
placed between grave accents (back- 
quotes)causcs ihe command output lo be 
treated just as if ii were a variable. In the 



following example, the ouipul of the 
seiime program is assigned lo the 
"lime" variable, so lhat the echo com- 
mand would issue "Ociober 9, 1989 
Monday 8:05:11 pm". 

time='setime -s' 
echo Slime 



PIPING AND REDIRECTION 

The shell provides all the conven- 
tional piping and redirection features 
present in OS-9, so thai progiam input 
and output can be diverted lo or from 
standard I/O or between programs (ste 
Table 3). 

MISCELLANEOUS 

The shell provides for error and fault 
handling (see "trap" Table 1), as well 
as the debugging of script files (see "set 
-v" and "sei -x" Table 1). 

PULLING IT ALL 
TOGETHER 

The following is a useful illustration 
of how a number of the shell features lie 
together into a practical, powerful pro- 
gramming tool, ll is a simple script file 
thai compiles C programs, sending ihe 
compile report lo a disk file, and ihen, 
only if each compilation was successful, 
links the programs together. 

# SCRIPT FILE 'ccc' 
tailed =0 
for source 
do 

if cc ${suurce}.c -sr 
then 

failed =1 
fi 
done 
ir [ Srailed -eq ] 
then 

link prog 

n 

#end of .scrip! 'ccc' 

My programs arc usually made up of 
more than one module. In ihe course of 
debugging ihcm, 1 may change several 
modules ai once, ihen compile and link 
ihem together. This script file allows ihis 
lo be done wiih a single command: 

ccc fl t*2 13 >err 



By redirecting the output from the 
script file with the ">eiT" lerm, any 
compilation errors will be placed in a file 
named "err", which I can read later. I 
could add an & lo ihe end of this com- 
mand, which would put ihe whole sciipt 
file execution into background. Then. 1 
could continue work from my terminal 
on some other problem while ihe "ccc" 
script is being executed. 

In this sample script file, the "for" 
command causes each module name (fl, 
f2 and O) to be assigned in turn to ihe 

variable "source". The "if cc " 

command line compiles each source and 
lests ihe result at the same lime. If any 
one of ihe compilations fails, "failed" is 
sei to 1; no computer time, or program- 
mer time, is wasted linking bad modules 
together. If all compilations succeed, 
then another script file, "link_prog", 
will be executed to link ail modules to- 
gether. 

Someone may be thinking, "the OS-9 
cc compiler can compile several pro- 
grams ai once, why bother." Ihe OS-9 
cc compiler will abort all subsequent 
compilations if any one fails; 1 prefer to 
see all of my enors at once, and fix them 
all at once. By composing ihis simple 
script file, I can make ihe cc compiler 
behave ihe way 1 wani ii lo, simplifying 
my work and increasing my productiv- 
ity. I use ihe shell lo perform all manner 
of housekeeping lasks and preparation of 
serialized software releases: life before 
the shell was a lot harder. 

' Stephen R. Bourne, THE UNIX SYSTEM V 
ENVIRONMENT. Menlo P»rtt. CA. Addiion 
Weiley Publishing Company. 1987 (ISBN 0-201- 
18484-1) 

' M irk G. Sot* 11. A PRAC1 1CAL G UIDE TO 
UNIX SYSTEM V, Menlo Park, CA. Ihe 
Benuunw^junmings Publishing Company, INC.. 
1985 (ISBN 0-8053-8915 6) 

• AT4T. UNfX SYSTEM V, Rtltast 32. Engle- 
wood Cliffs. NJ. Prentice Hail. Inc.. 1989 (ISBN 
01 1-944 1 33-6) 

• Ki»re aiiisuan. THE UNfX OPERATING 
SYSTEM.Sev, York. NY. John Wiley A Sora. 
1988 (ISBN 0-47 1-84781 X) 



68 Micro Journal 



JanJFsb. '90 



19 



Table 4 

expr - evaluate arguments 85 an expression 

expr arg ... 

The arguments arc taken as an expression. After evalu- 
ation, the result is written on the standard output. Terms 
of the expression must be separated by blanks. Note that 
is returned to indicate a zero value, rather than a null 
string. Strings containing blanks or other special char- 
ados should be quoted. Integer-valuad arguments may 
be preceded by a unary minus sign. Internally, integers 
are treated as 32-bit. 2's complement numbers. 
The operators and keywords are listed below. The list is 
in order of increasing precedence, with equal pracc- 
dence operators grouped within ( ] symbols. 

expr I expr 

Return the first expr if it is neither null nor 0; otherwise 
return the second expr. 

expr & expr 

Renun the first expr if neither expr is null or 0: other- 
wise return 0. 

expr (=. >, >=, <, <=, !=) expr 

Return (he result of an integer comparison if both argu- 
ments are integers: otherwise return the result of a 
lexical comparison. 

expr (+. -) expr 

Addition or subtraction of integer-valued arguments. 

expr (*, /, %) expr 

Multiplication, division, or remainder of the integer- 
valued arguments. 

expr : expr 

The matching operator : compares the first argument 
with the second argument which must be a regular ex- 
pression. Regular expression syntax is the same as that 
of ed(l), except that all patterns arc anchored at the be- 
ginning of the string. Therefore, A is not a special 
character in that context. Normally, the matching op- 
erator returns the number of characters matched (0 on 
failure). Alternatively, the (...) pattern symbols can be 
used to return a portion of the first argument. 





Table 5 


test condition 


evaluation command 


test expr 




Test evaluates the expression expr and, if its value is 


true. 


returns a zero exit status; otherwise, a non-zero 


(false) exit status is relumed; lest also returns a non- 


zero exit status if there arc no arguments. The follow- 


ing primitives are used to construct expr 


-r file 


True if file exists and is readable. 


-w file 


True if file exists and is writable. 


-x file 


True if file exists and is executable. 


f file 


True if file exists and is a regular file. 


-d file 


True if file exists and is a directory. 


p file 


True if file exists and is a named pipe (fifo). 


-k file 


True if file exists and its sticky bit is set. 


-s file 


True if file exists and has a size greater than 




zero. 


-t Ifildes] 


True if the open file whose file descriptor 




number is fildes (1 by default) is associated 




with a terminal device. 


-zsl 


True if the length of the string si is zero. 


•n si 


True if the length of the string si is non-zero. 


si =s2 


True if strings si and s2 arc identical. 


si != s2 


True if strings si and s2 arc not identical. 


si 


True if si is not the null string. 


nl -eq n2 


True if the integers nl and n2 arc algebraically 




equal. Any of the comparisons -ne, -gt. -ge. -ll. 




and -le may be used in place of -eq. 


These primaries may be combined with the following 


operators: 


1 


Not. 


-a 


And. 


-0 


Or. 


(expr) 


Parentheses arc for grouping. 


All the operators and flags are separate arguments to 


test. 





UNIX it a iradcmirk of AT&T BcU laboratories 

OS-9 it a mdenurk of Microwatt Systems Corp. 

S/R is a trademark of Ull/itcience. a division of 
Gibbs Laboratories, Inc. 



FOR THOSE WH 




68 MICRO 
JOURNAL™ 



] 



20 



JanJFab. '90 



68 Mcro Journal 



GRAB YOUR OS-9 



APPLICATIONS 



By : Jan Johansen. President 
Johansen & Associates 
Park Ridge. IL. 6006X 



MANUALS 



OS-9 does not want for praise, 
but it has not yet been equipped 
with sophisticated desktop pub- 
lishing tools like Ventura or Page- 
Maker, or even simple page layout 
features like those found in Word 
Perfect 5.0 or Microsoft Word. 
When an OS-9 applications pro- 
grammer wants a professional 
looking manual, we take the 
ASCII output from his OS-9 word 
processing programs and feed It 
into persona] computer desktop 
publishing software. The results 
have been pleasing and. judging 
from our repeat business, effec- 
tive. We have resources for trans- 
lating text into all the major lan- 
guages, and we employ graphic 
design experts who know how to 
create dramatic formats and use a 
variety of graphics packages to 
embellish a document with excit- 
ing "clip-art". However, until re- 
cently, our style was a bit 
cramped by the fact that we had 
no convenient way to create 
screen-grabs from our clients' 
OS-9 applications. 

Anyone who has ever used an 



applications manual knows Just 
how helpful the Image of an actual 
application screen can be. A pic- 
ture is worth a thousand, other- 
wise possibly tedious, words. In 
our experience. It takes much less 
time to write a soltware manual 
which contains screen-grabs, 
and the associated products are 
much easier to sell. 




Anyone who haa 
ever used an 
applications 
manual knows 
Just how helpful 
an Image of the 
actual screen 
canba. 



Now there is a solution! Ul- 
trascience has created a 68K 
coprocessor board, the PC68K1. 
which runs OS-9 inside virtually 
any IBM-style personal com- 
puter' . The board was designed to 



provide a cost-elfectlve multi- 
user environment for personal 
computers, but we are recom- 
mending it to our OS-9 based 
clients as a low-cost way to obtain 
screen-grabs for their manuals. 
The cost savings on the first 
manual usually washes out the 
cost of the PC68K 1 (suggested list 
under $2000.00). 

The PC68K1 and OS-9 install 
In minutes. OS-9 runs concur- 
rent with DOS and the monitor 
can be hot- keyed back and forth 
between the two operating sys- 
tems. First, we boot OS-9 in mem- 
ory resident mode. Then, we start 
HOTSHOT (this sequence is Im- 
portant in order to avoid an error). 
HOTSHOT (suggested list price 
$249.00 2 ) permits the user to 
select a "hot key" to save the 
image of any monitor screen to 
disk. As an OS-9 application 
runs, the operator simply enters 
the screen-grab hot key when he 
wants to record a screen. HOT- 
SHOT will prompt for a path and 
file name, and the screen is re- 
corded to disk - it's that simple. 



66 Micro Journal 



J»n./Feb. '90 



21 



Using Ventura, we can blend 
our clients' OS-9 screen-grabs 
Into their manuals. We can also 
edit the screen-grabs, maintain- 
ing the appearance of almost any 
font or graphics. This editing abil- 
ity is particularly useful for 
"blanking" serial numbers or 
combining the effect of sequenc- 
ing through several fields on a 
screen Into a single grab. 

The combination of running 
OS-9 on a PC and using HOT- 
SHOT to produce and edit valu- 
able screen visuals has certainly 
streamlined our documentation 
process and. more importantly, 
has made the final result much 
more effective. If you have any 
questions, please feel free to call 
or write us at 910 Busse Hwy.. 
Park Ridge. 1L 60068. phone: 
312/698-9471. fax: 312/825- 
2737. 



Help Index | 

"> AUT0HEI.P - renoue'restore help lire at bo t ton of screen (toggle) 
BEEP - set error beeper on/off (toggle) 
BOLD - insert or reraue boldface for an Hen 
BORDER - renove'restore the border of the current uindou (toggle) 
CHAH6E-IYPE - change current file t** to text or document (toggle) 
CLOSE - close the current uindou or its footnote uindou 
COnWNDS - description of comunds used in project files 
COrlPVIE - conpvte a sun or fomula 
CONFIDENCE - change level of confidence 

COPY - cops a line, uord< sentence, paragraph, block or reminder 
DELETE - delete a line, uord, sentence, paragraph, block or reminder 
DICTIONARY - check spelling. Maintain dictionaries or set options 
DIRECTORY - lists the files on a disk drive or directory 
DISPLAY - alter display node to black/white, color or graphics 
DRAU - drau boxes, lines or grids in graphics font 
EXECUTE - execute a project file 

FILE - copy, erase or renane a file; change the default data path 
FIND - search for an lten of text 
FONT - select font for neu it bus or change font for existing itens 



Fl Help for topic F2 Print help FIB Finished Cursor keys 
Docunent: (none) Pg:i LnU Ps:& FM:8 Pont: Standard 



Insert ON 



Snart Softuare 

Copyright (c) 1984, 198S, 1386. 1387, 1988 

Infornix Softuare, Inc. 




Select option: Quit 
exit naln-Henu 



WtMikhPHl 



Uordprocesser Dfcle-hanager Tine-Manager 



NOTE: Wc had already submitted this 
technical noic when wc icamed thai Ul- 
trascicncc is providing OS-9 for Macin- 
tosh computers. It seems likely that the 
COMMAND-SHIFT-3 feature of MAC 
software may create a useable M AC .pic 
file from OS-9 screens. Wc will report on 
this possibility in a future issue. 



Ultra science 

A Division of Gibbs Laboratories. Inc. 

1x24 Wilmcue Avenue 

Wilmcue. IL6O09I 

HOTSHOT Graphics 

SymSofi, Inc. 

P.O. Box 4477 

Mountain View. CA 94040 



FOR THOSE WH 




68 MICRO 

journal" 



22 



Jan./Fofe. '90 



68 Micro Journal 



'felcplume: (615) 842-4600 Soil tfl f LOS t Mcdid 



OS -9, llni'JfLX, 'JL-EX, S'X''l>OS 

SOFTWARE 



Jok; (615) 842-7990 



ASSEMBLERS 

ASTRUK09 from S.E Media ■■ A "Structured Assembler for ihc 6809" 
which requires the TSC Macro Assembler. 
FLEX. SKDOS, CCF $99.95 

DISASSEMBLERS 

SUPER SLEUTH from Computer Systems Consultants Interactive 
Disassembler; extremely POWERFUL' Disk File Binaiy/ASCn 
Examine/Change, Absolute or FULL Disassembly. XREF Generator. 
Label "Name Changer", and Files of "Standard Label Names" for 
different Operating Systems. 
Color Computer SS-50 Bus (all wl AL Source) 
CCD (32K Reqd) Object Only $49 00 

FLEX. SKDOS $99.00 - CCF Object Only $5000 UniFLEX $100.00 
CCF. with Source $99.00 OS-9. $101.00 ■ CCO. Object Only $50.00 
61010 SUPER SLEUTH - Similiar to 8-Bd Version except written 

Ml "C". 

68010 Disassembler $100.00 FLEX. UniFLEX. UNIX, XENIX. 

MS-DOS. SKDOS. OS-9 

OS-9I68K Object Only $100.00 or with Source $200.00 
DYNAMITE* - Excellent standard "Batch Mode" Disassembler. Includes 

XREF Generator and "Standard Label" Files. Special OS-9 options 

with OS-9 Version. 

CCF, Object Only $100.00 - CCO. Object OnlyS 59.95 

FLEX. SKDOS . Object Only $10000 ■ OS.9, Object OnlyllSODO 

UniFLEX Object Only $300D0 

CROSS ASSEMBLERS 

CROSS ASSEMBLERS from Computer System Consultants - Supports 
1802/5. Z-80, 6800/|/2/3/e71 1/HCI I. 6804. 6805/HC05/ 146805. 6809/00/01, 
6502 family. 8080/5, 8020/1/2/35/C35/39/ 40/48/C48/49/C49/50/8748/49. 
8031/5 1/8751.32000 and 68000/68010 Systems. Assembler and Listing 
formats same as target CPU's ionnai Produces machine independent 
Motorola S-Tcxt Includes Macro Preprocessor. Written in "C". 68000 or 
6809 •Macintosh.'Atari, FLEX. CCF, UniFLEX. OS-9. XENIX. UNIX. MS- 
DOS. SKDOS 

any object $50 or any 3 for $100 

airy source is an additional $50 or any 3 for $100 

Set of ALL object $200.00 - with source $500.00 

COMMUNICATIONS 

CMODEM Telecommunications Program from Computer Systems 

Consultants. Inc. - Menu-Driven: supports Dumb-Terminal Mode, 
Upload and Download in non-protocol mode, and the CP/M "Modem7" 
Oiristensen protocol mode to enable communication capabilities for 
almost any requirement- Wijtlcn in "C". 

FLEX. SKDOS. CCF. OS-9, UniFLEX. UNIX. XENIX. MS-DOS. 
with Source $100.00 - without Source $50.00 

X-TALK with CMODEM Source $14995 



PROGRAMMING LANGUAGES 

PASC from S.E. Media - A FI..EX9.SK-DOS Compiler with a definite Pascal 
"llavor". Anyone with a bit of Pascal experience should be able to begin 
using PASC lo good effect in short order. The PASC package comes 
complete with three sample programs: ED (a syntax or structure editor). 
EDITOR (a simple, public domain, screen editor) and CHESS (a simple 
chess program). The PASC package comes complete with source 
(written in PASC) and documentation. 
FLEX. SKDOS $9500 

WHIMSICAL from S.E. MEDIA Now supports Real Numbers. "Structured 
Programming" WITHOUT" losing the Speed and Control of Assembly 
Language! Single-pass Compiler features unified, user-defined I/O; 
produces ROMable Code; Procedures and Modules (including pre- 
compiled Modules): many "Types" up lo 32 bit Integers. 6-digii Real 
Numbers, unlimited sized Arrays (vectors only);, interrupt handling; 
long Variable Names; Variable Initialisation: Include directive; 
Conditional compiling; direct Code insertion: control of the Stack 
Pointer; etc. Run-Time subroutines inserted as called during 
compilation. Normally produces 10% less code than PU9 
FLEX. SKDOS and CCF - $195.00 

KANSAS CITY BASIC from S.E. Media - Basic for Color Computer OS-9 
with many new commands and sub-functions added. A full 
implementation of ihc IF-THEN-ELSE logic is included, allowing 
nesting to 255 levels. Stiings are supported and a subset of the usual 
string functions such as LEFTS. RiGIHS. MIDS. STRINGS, etc. are 
included. Variables are dynamically allocated. Also included are 
additional features such as Peck and Poke. A must for any Color 
Computer user tunning OS-9. 
CoCo OS-9 $39 95 

OmcgaSoR PASCAL from Certified Software - Exicniicd Pascal for 
systems and real-time programming. 

Native 68000/68020 Compiler. S57S for base package, options available. 
For OS-9/68000 and PDOS host system. 

6809 Cross Compiler (OS-9/68000 host) S700 for complete package. 

KBAS1C - from S.E. MEDIA - A "Native Code" BASIC Compiler which is 
now Fully TSC XBASIC compatible. The compiler compiles lo 
Assembly Language Source Code. A NEW, streamlined, Aslembler is 
now included allowing ihc assembly of LARGE Compiled K-BAS1C 
Programs. Conditional assembly i educes Run-lime package. 
FLEX . SKDOS, CCF. OS-9 Compiler /Assembler $99.00 

EDITORS & WORD PROCESSING 

JUST from S.E. Media -- Text Foimallcr developed by Ron Anderson; for 
Dot Mainx Printers, provides many unique features. Output 
"Formatied" Text to the Display. Use the FPR1NT.CM D suppl ied for 
producing multiple copies of the "Fonnatted" Text on the Primer 
INCLUDING IMBEDDED PRINTER COMMANDS (very useful at 
other times also, and wonh the price of the program by itself). "User 
Configurable" for adapting to other Printers (comes set up for Epson 
MX 80 with Graflrax); up to ten (10) imbedded "Piinter Control 
Commands". Compensates for a "Double Width" printed line. Includes 
ihe normal line width, margin, indent, paragraph, space, vertical skip 
lines, page length, page numbering, centering, fill, justification, elc. 
Use with PAT or any oiher editor. 

* Now supplied as a two disk sci: 

Disk* 1: JUSn.CMD object fUe.JUST2 1XT PL9 source:FLEX. SKDOS 

Disk #2. JUSTSC object and source in C FLEX. SKDOS. OS-9, CCF 



A.nmiiU; Uitod> 
O.OS-»,S.SK'tX)S 
y ■ FLEX, U . UnlO-LEX 
009 • Color CornpuUr «S-» 
CCF • Color Cornpuur FLKX 



South Txist Media 

5900 Cassandra Smith %£. ■ Xvrson, Tn. 3 7343 
reUphonc: 1615)342-4600 9SXX (6l5) 342-7990 




•• Shipping •• 

Add 1% VSJi. (mlo.J2.54) 
Foreign So trace Adds* 
Foreign Airmail Add 10* 
OtCJb.D.SMpp\ngOnlJ 



•OS-0 li ■ Tradwaar a o/Mkrowar* aod Motarolo.*FLEX aad UalFLEX arc Triasmii ksorTecBnkal S JIKWu Cntuul laale.'SK'OOS le ■ Trademark or Star. K Soft »are si rite Ira Cot p. 

68 rVfcro Journal Jsn./Feb. '90 23 



Telephone: (615)842-4600 SoUtft 'EciSt O^fcdill 



OS-9, 'Uni'JL'EX, 'JL'LX, S%*1DQS 

SO'J'PWA'-KiE 



'Ji,K:(6l5)S42-7 l >90 



The JTSC aid regular JUSTC source arc (wo separate programs. JTSC 

compiles lo * version ihn expels TSC Woid Professor type commands, 
(pp .sp.ee etc.) Great for your older lexl files. The C source compiles lo 
a standard syntax JUST.CMD object lile. Using JUST syntax (,p .u .y 
etc.) With all JUST functions plus several additional printer formatting 
functions. Reference the JUSISCC soun-e. For those wanting an 
excellent BUDGET PRICED word processor, with features none of lhe 
others have. This il it! 

Dili (I) . PL9 FLEX only. FLEX, SKDOS A CCF ■ S49.95 
Dirk Set a) ■ FIEX. SKDOS A CCF A OS-9 (C version) ■ S69.9S 

OS9 68KO0O complete with Source ■ 179.95 
PAT from S.E. Media - A full feature screen oriented TEXT EDITOR with 
all the best of "PIK™". For those who swore by and loved only PIE. 
this is for youl All PIE features and much morel Too many features to 
list. And if you don't like these, change oradd your own. PL 9 source 
furnished. "C source available soon. Easily configured to your CRT. 
with special config seclion. 

FLEX. SK DOS $129.50 

SPECIAL PAT/JUST COMBO (with source) 
FLEX, SK DOS $99.95, OS-9 68K Version S229.00 

SPECIAL PAllJUST COMBO 68K $24900 
Note: JUST in "C" source available for OS-9 
CEDRIC from S.E Media - A screen orient*! TEXT EDITOR with 

availability of 'MEN U' aid. Macro definitions, configurable 'permanent 
definable MACROS' - all standard features and the fastest 'global' 
functions in the west A simple, automatic termini] config program 
nukes this a real 'no hassel' product. Only AK in size, leaving the 
average system over 163 sectors for test buffer - appx. 14.000 plus of 
free mentor yl Extra fine for prog rammii g as well as texL 

FLEX. SKDOS $69 95 
BAS-EDIT from S.E. Media • A TSC BASIC or XBASIC screen editor. 
Appended lo BASIC or XBASIC, BAS-EDIT is transparent to normal 
BASIC/XBASIC operation. Allows editing while in BASIC/X BASIC. 
Supports lhe following functions: OVERLAY, INSERT and DUP 
LINE. Make editing BASIC/XBASIC programs S1MPLEI A GREAT 
lime and effort saver. Programmers love itl NO more ictyping entire 
lines, etc. Complete with over 25 different CRT terminal configuration 
overlays. 

FLEX. CCF. SK DOS $39.95 
SPELLB "Computer Diciionaiy" from S.E. Media - OVER 150,000 words! 
Look up a word from within your Editor or Word Processor (with the 
SPII.CMD Utility which operates in the FLEX, SKDOS UCS). Or 
check and update the Text after entry; ADD WORDS lo the Dictionary, 
"Rag" questionable words in the Teat, "View a word in context" before 
changing or ignoring, etc. SPELLB first checks a "Common Word 
Dictionary", then the normal Diciionaiy. ihen a "Personal Woid List", 
and finally, any "Special Word List" you may have specified. SPELLB 
also allows the use of Small Disk Storage systems. 

FLEX. SK DOS and CCF . $129.95 
STVLO-CRAPH from Great Plains Computer Co A full-scraen onenlcd 
WORD PROCESSOR --(uses the 51 x 24 Display Screen s on CoCo 
FI.EX/5K-DOS. or PBJ Wordpak). Full screen display and editing: 
suppons the Daisy Wheel propoitional printers. 

NEW PRICES 6809 CCF and CCO - S99.9S. 

FLEX. SKDOS or OS-9 - 1179.95, UniFLEX. $299 95 
STYLO SPELL from Great Plaint Computer Co - Fast Computer 
Dictionary. Complements Stylograph. 

NEW PRICES 6809 CCF and CCO - $69 95, 

FLEX. SKDOS or OS-9 - 199.95. UniFLEX- 1149.95 



STVLO-MERCEfrom Great Plains Computer Co. - Meige Mailing List lo 
"l-orm" Letters, Print multiple Files, etc., through Stylo. 

NEW PRICES 6809 CCF and CCO - 159.95. 

FLEX. SKDOS or OS-9 ■ $79 95. UniFLEX- $ 129.95 
STYLO-PAK ■■ Graph + Spell ♦ Merge Package Deallll 

FLEX. SK DOS or OS-9 $32995, UniFLEX - $549.95 

OS 9 68000 $695 00 

DATABASE ACCOUNTING 

XDMS from Westchester Applied Business Systems 

FOR 6809 FLEX or SKDOS (S/8") 

Up to 32 groups/fields per record! Up to 12 character file rimes I Up to 1024 
byte records) User defined screen and piint control! Process files I Form 
filetl Condiliqnal execution! Process chaining! Upward/Downward file 
linking! Pile joining! Random file virtual pagingl Built in utilitiesl Built 
in text line edilorl I'ully session oriented! Enhanced forms! floldfacc. 
Double width, Italics and Underline supported! Written in compact 
structured assembler! Integrated for PAST' execution! 
XDMS-IV Data Management System 

XDMS-IV is a brand new approach lo data management. Il not only permits 
users lo describe, enter and retrieve daia, but also lo proacss cnlirc files 
producing customized reports, screen displays and file output. 
Processing can cons in of any of a set of standard high level functions 
including record and field selection, sorting and aggregation, lookups in 
other files, special processing of record subsets, custom report 
formatting, totaling and subtotaling, and presentation of up to three 
related files as a "database" on user defined output reports. 
POWERIUL COMMANDS! 

XDMS-IV combines lhe functionality of many popular DBMS software 
sys ms with a new easy lo use command set into a single uitcgratcd 
package. We've included many new features and commands including a 
set of general file utilities, lhe processing commands are Input-Process- 
Output (IPO) which allows almost instant implementation of a process 
design. 

SESSION ORIENTED! 

XDMS-IV is session oriented. Enter "XDMS" and you arc in instant 

command of all lhe features. No more wailing for a command to load in 
from disk I Many commands are immediate, such asCREATK (file 
defuulion). UPDATE (file editor), PURGE and DELETE (utilities). 
Others arc process commands which ate used lo create a user process 
which is executed with a RUN command. Either may be entered into a 
"process" file which is executed by an EXECUTE statement. Processes 
may execute other processes, or themselves, either conditionally or 
unconditionally. Menus and screen prompts are easily coded, and entire 
user applications can be run without ever leaving XDMS-IV 

ITS EASY TO USE! 

XDMS-IV keeps data management simple! Ralher lhan design a complex 
DBMS which hides the true nature of the data, we kept XDMS-IV file 
oriented, lhe user view of data relationships is presented in reports and 
screen output, while the actual data reiidcs in easy to maintain files. 
This aspect permits customized presentation and repons without 
complex redefinition of the database Tiles and structure. XDMS-IV may 
be used for a wide range of applications from simple record 
management systems (addresses, inventory ...) to integrated database 
systems (order entiy, accounting...) 

The possibilities are unlimited... 

FOR 6809 FLEX or SK-DOSiS"/*" Disk) $249.95 



A<iiia*iinr i-im* 

O.OS », S. SK'DOS 
r , FLEX, tJ p UnlrTEX 
CCS) . Cakjr Caaaaulcr 04 » 
CCF ■ Goto! CoajpvUr KLi'X 



»<>K -* 1 1 a 1 1 .4*nu r k at M ktrv-u ttmni 




South Tost 'Media 

5900 Cassandra Smith 9\st. ■ Muffon. Tn. i 734} 
Ttkphmt: (61 5) 842-4600 'JVC (61 5) 842-7990 



fH.ii.tVr card 



•• Shipping •• 

A*d J* UiA. (nla.SlM) 
Fortlaa Surf... Add S* 
tWIpi Alnn.ll Add 10* 
WCOD. ShlppltiiOnlj 



24 



McjtproU,.'r-1,r:X »nd t.n[r1.KXiuTrnt»nMrluntT»i>iiik.l. l iriUiiit<..fmill.nli -SH'IKK In tr«<ttm»rtufSn>.K Sunn.rr .Sfilrnn Itir^, 

JanJFeb. '90 68 Micro Journal 



'Telephone: (6 15) $42-4600 SOU tfl 'EOS t Mcdld 



OSS, iim'JVLX, ?£JEX,$ < K?'DO$ 

$OTTWfl3t£, 



'fait: (61$) 842-7990 



UTILITIES 

BasicOT XRcf from S.E. Media --This Basic09 Cross Reference Utility is a 
Basic09 Program which will produce a "pretty printed" listing with each 
line numbeied. followed by a complete cross referenced listing of all 
variables, externa I procedures, and line numbers called. Also includes a 
Program List Utility which outputs a fast "pretty printed" listing with 
line numbers. Requires Basic09 or RunB. 

OS-9 A CCO object only - $39.95; with Source - $79.95 

BTree Routines - Complete set of routines to allow simple implementation 
of keyed files -for your programs - running under BasicQ9. A real time 
saver and should be a pan of eveiy serious programmers tool-box. 
OS-9 A CCO object only - S89.95 

BASIC09 TOOLS consist of 2 1 subroutines for Basic09. 

6 were wriuen in C language and the remainder in assembly. 
All the routines arc compiled down to native machine code which 
makes litem fast and compact. 

I. CFII.L - fills a string with chaiactcis 
Z DI'EEK - Double peck 

3. DPOKE - Double poke 

4. FPOS -- Current file position 
S.FSIZE-Filesiie 

6. FTRIM — removes leading spaces from a string 

7. GETPR - returns lite current process ID 

8. GETOPr - gets 32 byte option section 

9. GETUSR - gets the user ID 
10.GTIME-- gets the lime 

I I. INSERT — insert a suing into another 

12. LOWER — converts a siting into lowercase 

13. READY - Checks for available input 

14. SETPRIOR -- changes a process prioiity 

15. SETUSR - changes the user ID 

16. SETOPr - set 32 byte option packet 

17. STIME -- sets the lime 

18. SPACE -- adds spaces to a string 

19. SWAP - swaps any two variables 

20. SVSCALL » system call 

21. UPPER — converts a string to uppercase 
For OS-9 • 544,95 - Includes Source Code 

FULL SCREEN FORMS DISPLAY from Computer Systems Consultants - 
TSC Extended BASIC program supports any Serial Terminal with 
Cursor Control or Memory-Mapped Video Displays; substantially 
extends the capabilities of the Program Designer by providing a table- 
driven method of describing and using Full Screen Displays. 
FLEX. SK-DOS and CCF. UniFLEX . $75.00. with S»urce ■ $50 /Hi 

SOLVE from S.E. Media - OS-9 Levels 1 and U only. A Symbolic Object/ 
Logic Verification A Examine debugger. Including inline debugging, 
disassemble and assemble. SOLVE IS THE MOST COMPLETE 
DEBUGGER we have seen for the 6809 OS-9 series) SOLVE docs it 
alii With a rich selection of monitor, assembler, disassembler, 
environmental, execution and other miscellaneous commands, SOLVE 
is the MOST POWERFUL tool-kit item you can own! Yet, SOLVE is 
simple to use! With complete documentation, a snap! Everyone who 
has ordeied this package has raved! Sec review - 68 Micro Journal - 
December 1985. No 'blind' debugging here, full screen displays, rich 
and complete in information presented. Since review in 68 Micro 
Journal, this is our fastest moverl 

Level* I A II only . OS-9 S69.9S 



DISK UTILITIES 

OS-9 VDisk from S.E. Media --for Level I only. Use the Extended Memory 
capability of yourSWTPC or Gimix CPU card (or similar format DAI') 
for F AST Program Compiles, CMD execution, high speed interprocess 
communications (without pipe buffers), etc. - SAVE that System 
Mcmoiy. Virtual Disk size is variable in 4K increments up to 960K. 
Some Assembly Requited. 

Level I OS-9 object $79.95. with Source $149.95 
O.F from S.E. Madia - Wriuen in BASIC09 (wiih Source), includes: 

REFORMAT, a BASIC09 Program that reformats a chosen amount of 
an OS-9 disk to FLEX, SK-DOS Formal so it can be used nonnally by 
FLEX, SK-DOS; and FLEX, a BASIC09 Program that dues the actual 
read or write function to the special O-F Transfer Disk*, user-fiiendly 
menu driven. Read the FLRX. SK-DOS Dircctoiy. Delete FLEX. 
SK-DOS Files. Copy both directions, etc. FLEX, SK-DOS users use the 
special disk just like any other FLEX, SK-DOS disk 

OS-9 - 6809 $79.95 
1.SOR T from S.E. Media - A SORT/MERGE package for OS-9 (Level 1 & U 
only). Sons records with fixed lengths or variable lengths, Allows for 
either ascending or descending sort. Sorting can be done in cither ASC II 
sequence or alternate collating sequence. Right, left or no justification of 
data fields available, LSORT includes a full set of comments and errors 
messages. 

0S9 $85.00 
HIER from S.E. Media - II1ER is a modern hitrarcnal storage system for 
users under FLEX, SK-DOS. It answers the needs of those who have 
hard disk capabilities on their systems, or many files on one disk - any 
size. Using HIER a regular (any) FLEX, SK-DOS disk (8.5. hard 
disk) can have sub directories. By this method the pioe-lems of 
assigning unique names to files is less burdensome. Different files with 
the exact same name may he on the same disk, as long as they ate in 
different directories. For the Winchester user this becomes a must. Sub- 
directories are the modem day solution that all cuirent large systems use. 
Each directory looks to FLEX, SK-DOS like a re ular file, except 
they have the extension VOIR'. A full set of dircctoiy handling 
programs are included, making the operation of HIER simple and 
straightforward. A special install package is included lo install HIER to 
your particular veision of FLEX, SK-DOS. Some assembly required. 
Install indicates each byte or reference change needed. Typically - 6 
byte changes in source (furnished) and one assembly of HIER is all that 
is icquired. No programming required! 

FLEX - SKDOS $79.95 
COPY MULT from S.E. Media -• Copy LARGE Disks to several smaller 
disks. FLEX. SK-DOS utilities allow the backup of ANY size disk to 
any SMALLER size diskettes (Hard Disk to floppies, 8" to 5", etc.) by 
simply inserting diskettes as requested by COPYMULT. No fooling 
with diieclory deletions, etc. COPYMULT.CMD understands noimal 
"copy" syntax and keeps up with files copied by maintaining directories 
for both host and lecciving disk system. Also includes BACKUP.CMD 
to download any size "random" type tile; RESTORE.CMD to restructure 
copied "random" files for copying, or recopying back to the host system; 
and FREELINK.CMD as a "bonus" utility that "relinks" the free chaitiof 
(loppy or hard disk, eliminating fragmentation. 
Completely documented Assembly Language Source files included. ALL 4 
Programs (FLEX. SK-DOS. 8~ or 5") $99 50 



Atiitihiiit) Lti«ndi 
O. OS »,S. SK-DOS 
K.HEX.U.UnlFLKX 
OCT • Cotor Computer OS-9 
CCF • Color Computer KLKX 



South 'East (Media 

5900 Cassandra Smith $4. ■ tfitfon, In. 37343 
Tckphont: (615) 842-4600 TAX (6l5) 842-7990 



mastercard] 



•• Shipping •• 

Add 1% USA- ("ill. SIM) 

Fotclrtn Surface Add S% 

rortlcn Alnimll Add 10* 
Or C.O.D.SKIpploaOiil; 



•OS.* tuTraojmarli of Mkro— rtmni Molomla 'KI.KX anil tinlKl.KX ■" Tndtmarkmr Tunnkal s r mmi ITonmll.nu-'.'iK'IXlS Hi Tiad«narkor.S»».|t. SoTlw. r< Sjnttmi Corp. 

68 Micro Journal JarUFeb. '90 25 



'Tefeplnme: (615)842-4600 SOUtfi 'East 9^(edia 



OS-9, llm'JL'EJC, 'JL'EX, S'K''DOS 

soyrwwRtE 



Tax (615) 842*7990 



VIRTUAL TKRMINAI. from S.E. Media • Allows one lenninil to do ihc 
woik of several. The user miy sun is many as eight tasks on one 
icnninal. under VIRTUAL TERMINAL and switch hade and forth 
rx:iwecti tasks at will. No need to exit each one: just jump back and forth. 
Complete with configuration program. The best way to keep up with 
Ihose background programs. 

6809 OS-9 & CCO object only • $49.95 

FLEX.SK »OS DISK UTILITIES from Computer Systems Consultants - 
Eight (8) different Assembly Language (with Source Code) FLEX, 
SK-DOS Utilities for cveiy FLEX . SK-DOS Uteri Toolbox: Copy a Tile 
withCRC Emm: Test Disk forerrors; Compare two Disks: a fast Disk 
Backup Program: Edit Disk Sedan; Linearize Free-Chain on the Disk: 
prim Disk Identification; and Son and Replace lite Disk Directory (in 
sorted order). - I'LUS - Ten XBASIC Programs including: A BASIC 
Resequenccr with liXTRAs over"HHNUM" like check for missing label 
definitions, processes Disk to Disk instead of in Memory, etc. Other 
programs Compare, Merge, or Generate Updates between two BASIC 
Programs, chedt BASIC Sequence Numbers, compare two unscquenced 
files, and 5 Programs for establishing a Master Directory of several 
Disks, and sorting, selecting, updating, and printing paginated listings of 
these files. A HASIC Cross-Reference Program, written in Assembly 
language, which provides an X-Ref Listing of the Variables and 
Reserved Words in TSC BASIC. XBASIC, and PRECOMPILER 
BASIC Programs. 

AIL Utilities include Source (either BASIC or A.L. Source Code) 
FLEX. SKDOS and CCF - $5000 
BASIC Ulililiet ONLY for UniFLEX ■ - HO. 00 

MS-DOS to FLEX Transfer Utilities to OS-9 For 68XXX and CCOS-9 
Systems Now RIIAD - WRITE DIR • DUMP • EXPLORE FLEX 4 
MS-DOS Disk. These Utilities come with a nch set of options allowmg 
the transfer of text type files fiomAo FLEX A MS-DOS disks. 'CuCo 
systems require the D.P. Johnson SDISK utilities and OS-9 and two 
drives of which one must be a "host" floppy. 

'CvCo Version- $69 95 6SXXX Version $149.95 

Atari Version $99.95 



MISCELLANEOUS 

TABULA RASA SPREADSH EET from Computer Systems Consultants » 
TABULA RASA is similar to DESKTOP/PLAN: provides use of tabular 
compulation schemes used for analysis of business, sales, and economic 
conditions. Menu-driven: extensive rcpon-generaiion capabilities 
Requires TSCs Extended BASIC. 

FLEX. SK DOS and CCF. UniFLEX- $50.00. wu* Source ■ $100 00 
DYNAC.U.C - Electronic Spread Sheet for the 6809 and 68000. 
UniFLEX- S39SOO. FLEX. SKDOS. OS-9 and SPECIAL CCF $250 00 
OS9 68K .$29900 

FULL SCREEN IN VF.NTORY/MRI' from Computer Systems Consultants 
Use the Full Screen Inventory Systran/Materials Requirement Planning 
for maintaining inventories. Keeps item field file in alphabetical order 
for easier inquity. locate and/or piim records matching pailial or 
complete item, description, vendor, or attributes; find backordcr or below 
stock levels. Print-outs in item or vendor order. M RP capability foi the 
maintenance and analysis of Hierarchical assemblies of items in the 
invcntoiy file. Requires TSCs Extended BASIC. 
FLEX.SKDOSondCCF. UniFlEX - $50.00. wuh Source ■ $10000 



FULL SCRF.EN MAILING LIST from Computer Systems Consultants - 
Ine Full Screen Mailing List System provides a means of maintaining 
simple mailing lists. Locate all leconls matching on partial or complete 
name, city, state, zip, or attributes for Listings or Labels, etc. Requiics 
ISCs Extended BASIC. 
FUZX , SK.DOS and CCF. UniFLEX. $50.00, with Source .$100.00 



• 1ET-TRAC Forccute r from S.E. Media .. An XBASIC piogram that plant 
a diet in lenns of either calories and percentage of carhohyd rales, 
proteins and fats (C P G%) or grams of Carbohydrate. Protein and Fat 
food exchanges of each of the six basic food groups (vegetable, bread, 
meal, skim milk, fniii and fat) for a specifie individual. Sex. Age, 
Height, Present Weight, Frame Size. Activity Ixvcl and Basal Metabolic 
lixte for normal individual are taken into account. Ideal weight and 
sustaining calories fur any weight of Ihc above individual are calculated. 
Provides number of days and daily calendar after weight goal and calorie 
plan is determined. 

FLEX. SK DOS . $59.95. UmFUDC - $89.95 



GAMES 

RAPIER - 6809 Chess Program from S.E. Media - Requires FI JIX. 

SK-DOS and Displays on Any Type Terminal. Features: Four levels of 
play. Swap side. Point scoring system. Two display boards. Qiange 
skill level. Solve Checkmate problems in 1-2-3 4 moves. Make move 
and swap sides. Ilay while or black. This Is one of the strongest 
CHESS programs running on any microcomputer, estimated USCF 
Rating 1600* (belter than most 'club' players ot higher levels) 
FLEX. SK DOS and CCF . $79 95 
SEW 



MS-DOS and Macintosh 

Software at Discounted Prices 

"Call for prices, it" II be worth the savings." 

(615) 842-4600 
FAX (615)842-7990 



A.il&ollllj Utrno. 
O.OS-»,S. SX'DOS 
>' i FLEX. U • CrilFLCX 
era . Color Ovrxiur os-t 
CCF . Color CompuUT FLEX 



Sou t ft Tost Media 

S900 Caaandra Smith <U- - 9fa(fon, In. 3 7343 
reCcpHams (6 IS) 842-4600 7XK (61 S) 842-7990 




" Shipping •• 

AM 2 % USJl. (BIB. Ill*) 
Forrtoo So/totr AM 1% 
Forrip Airmail AM 1!» 
Or CX3.D. Skloptna Ooljr 



Ft atSjkrnmt »nJ Motorola-' Fl.KX one 1 DnlFlTJ i»Tr.o*«iuw»»ol"r»IHHc»ISjitrn»< muulionli.-SH'itos t.. TuakiMrkirsur K Soflwort SpUmi luro. 

JanJFeb. '90 68 Micro Journal 



26 



OS9 
"File Manager Round Up" 



"Steven Weller Windsor Systems" 



Pile Manager Round Up 



The key to fast, effective and 
convenient use of OS-9 I/O lies 
in the choice of Hie manager. 
Use the wrong one and the re- 
sult is likely to be slow, ineffi- 
cient, or Just plain awkward to 
use. however good the driver. 
Coding around the problems 
can help, but at the expense of 
reduced portability and in- 
creased programming time. 
Ihere is more to life than SCF 
and RBF for controlling I/O 
devices, as this article explains. 

This article brielly describes 
an array of OS-9/68k file man- 
agers that are available to reach 
the parts that the Microware file 
managers cannot. It goes on to 
consider the pros and cons of 
growing your own file manager 
at home, giving some idea of the 
strategy needed and problems 
you are likely to encounter. 

Microware's standard file 
managers cater well for a wide 
range of standard devices in- 
cluding terminals, magnetic 
disks, tapes, and networking 
and provide an obvious first 
choice for most applications. 
Other classes of devices, and 
particulary intelligent devices, 
need file managers written 



specifically to match their capa- 
bilities. Analog to digital con- 
verters are simple devices to 
operate, for instance, and may 
be driven through SCF. but 
become severely speed -limited 
by the overheads that SCF 
imposes. Intelligent devices 
cause more problems since they 
are almost always block-ori- 
ented and multi-channel - SCF 
is neither. 

There is a surprisingly rich 
choice of OS-9 file managers 
currently available. Oifthetop 
of my head I can think of four- 
teen: seven from Microware. 
They cover a wide range of appli- 
cations, including IEEE-488 
devices, graphics. WORM disks, 
intelligent I/O cards, pipes, and 
PC disks. 

Here is a run-down of the 
third-party file managers I 
know of (for suppliers see the 
end of this article): 



SPF 

Sequential Packet 

File Manager 

Galactic Industrial's SPF is a 
block-oriented multi-channel 
file manager aimed at intelli- 
gent I/O boards. All file man- 
ager entry points are passed di- 
rectly to the driver, allowing in- 



telligent serial. ADC. DAC. and 
signal processing cards to be 
driven at very high speed. Read 
and write accesses are sepa- 
rately queued, and can be run 
independently. Additionally, it 
has the line editing capabilities 
of SCF. so can be used to drive 
normal terminals through in- 
telligent serial boards. Source 
for an example driver is sup- 
plied. 



Gksman 

Graphics File Manager 

Snowtop Computer's 

Gksman is an escape-sequence 
driven multi-channel graphics 
file manager. It performs a wide 
range of graphical functions in- 
cluding windowing, clipping, 
polylines, markers, high-speed 
text, segments, input echo, 
mouse control and pointer dis- 
play, wide lines, complex poly- 
gon filling and cross-hatching, 
and can emulate SCF to provide 
a terminal on a graphics screen. 
It can drive graphics chips, bit- 
mapped displays. Intelligent 
workstations, dot-matrix and 
laser printers, and pen plotters. 
It is supported by C libraries 
and includes an input event 
queueing system. 



68 Micro Journal 



Jan./Feb. '90 



27 



MFM 

Memory File Manger 

The Memory File Manager 
from Windsor Systems operates 
much like a RAM disk under 
RBF with several important dif- 
ferences. It dynamically sizes 
the memory "disk" using only 
as much system memoiy as it 
requires to store the files it has. 
Aimed at ROM-based applica- 
tions, it supports only a single 
directoiy level for simplicity and 
speed, and can access data 
modules as files, allowing files 
like 'startup', 'termcap'. and 
'umacs.hlp' to be ROMmed for 
use by any program. The 
equivalent of the sector size in 
MFM is user-selectable and 
MFM can replace RBF in many 
ROM-based applications. 



WRF 

WORM File Manager 

The Write Once Read Many 
optical disk file manager from 
Galactic Industrial solves many 
of the problems associated with 
the relatively slow WORM me- 
dia. It supports the hierarchi- 
cal RBF directory structure, 
caching directoiy entries to 
reduce seek times. It allows 
multiple files to be open for 
reading, but only one file to be 
open for writing. Files can be 
modified and deleted, and all 
old versions of files are access- 
able. In addition, logical inter- 
leaving and file storage in se- 
quential logical sectors im- 
proves the access speed. 



MSF 

MS-DOS Disk File Manager 

Galactic Industrial's MSF 
goes much further than 
Microware's PCF PC disk file 
manager. It allows all utilities 
but dcheck. format, and free to 
be used on MS-DOS formatted 
disks and provides three extra 
utilities to replace them. File 
names and data structures are 
automatically converted be- 
tween the two systems, and all 
formats from 360K to 1.44M 
(and hard disks) are supported. 
Additionally, a utility is pro- 
vided to convert existing de- 
scriptors to MS-DOS descrip- 
tors. Many existing drivers and 
applications programs will work 
with MSF without modification. 



IBF 

IEEE 488 Bus File Manager 

ARK Corporations's IBF pro- 
vides multi-channel control of 
IEEE-488 bus equipment. It 
automatically handles all ad- 
dressing protocols, allowing 
IEEE-488 devices to be simply 
driven with normal I/O system 
calls. Fifteen debugging utili- 
ties are provided, allowing de- 
vices to be controlled from the 
command line. A C library gtves 
access to all facilities via Get- 
Status and SetStatus calls. It is 
block-oriented, and the drivers 
supplied support DMA opera- 
tion. A locking mechanism pre- 
vents collisions from multiple 
processes. 



PC9 

PC to OS-9 File Manager 

Quin Systems' PC9 system al- 
lows an MS-DOS computer to 
be used as a terminal to mul- 
tiple processes on a remote OS- 
9 system linked by a single se- 
rial cable. Each OS-9 process 
displays through a resizeable, 
moveable window on the PC 
screen. Terminal emulation fa- 
cilities support uMACS and 
other screen editors and pro- 
vide a programmable PC key- 
board. Access to PC disk drives 
is also available through the 
OS-9 unified I/O system, giving 
disk capability to ROM based 
OS-9 systems. A hot key 
switches between DOS and OS- 
9 displays. A fast version driv- 
ing Quin's Topaz LAN will be 
available Q2 90. 



Loglo 

Logical I/O File Manager 

Windsor Systems' Logio is a 
multi-channel block-oriented 
file manager controlling non- 
intelligent digital and analog 1/ 
O devices. It enables physical 
devices to be split into a number 
of logical devices for use by 
multiple processes and 
matches physical data size and 
alignment to that used by the 
calling program. Signals and 
events can be triggered when 
physical conditions become 
true, allowing alarm condition 
monitoring. Future develop- 
ments include automatic lin- 
earization for analog devices 
and facilities for accurately 
limed input and output. Loglo 
will be available Ql 90. 



28 



Jaiv/Feb. '90 



66 Micro Joumaf 



Do It Yourself 
File Managers 



Writing your own file man- 
ager can be a very rewarding, if 
costly, experience. The average 
licence price of the file manag- 
ers Just described is around 
$1900. somewhat less than the 
cost of a programmer for a week. 
The end result, however, can fit 
your application exactly. 

To write an OS-9 driver you 
must know something of the 
internal workings of OS-9. have 
the technical documentation for 
the appropriate iile manager to 
hand, and understand the 
hardware of the device you wish 
to drive. To write a file manager 
is a much harder job, not be- 
cause the code is any more dif- 
ficult, but because a great deal 
more knowledge and experience 
os OS-9 is required. 

Since the file manager inter- 
faces the kernel to the driver, 
the kernel-file manager inter- 
face has to be well understood in 
order that the file manager can 
be written at all. The file man- 
ager-driver interface, the path 
descriptor, device descriptor, 
and static storage definitions 
are all defined by the file man- 
ager writer and must be care- 
fully thought out. As the file 
manager designer, this freedom 
comes at a price: you are unfor- 
tunately also expected to write 
a great deal of technical docu- 
mentation for those who will 
write drivers for it. 

The freedom that a home- 
grown file manager gives is 
enormous. For instance, the 
file manager controls simulta- 
neous accesses by multiple 
processes on dilferent paths 



(the kernel queues multiple 
accesses on the same path), so 
the file manager writer has 
complete control over multi- 
process access to the driver, 
possibly, like SPF. giving all the 
control to the driver. Processes 
can be created by a file manager 
(SBF and NFM do this), and data 
modules and other structures 
can be used to overflow the 
standard path descriptors and 
process descriptors. File man- 
agers can be written to emulate 
SCF in order to include features 
that are not currently supplied, 
such as multi-channel access 
or improved line editing facili- 
ties, as has been done in PC9. 
Either C or assembler can be 
used to write file managers; my 
choice is C. Once the interfaces 
to the driver and kernel are 
written in assembler, the inter- 
nals are most easily coded in C. 
Using C for drivers is a little 
more tricky because of the high 
degree of hardware interaction 
and the need for speed. OS- 
9000. written almost entirely in 
C. almost requires that file 
managers are coded likewise. 
For OS-9000 the kernel and 
driver interfaces have been 
made C-friendly and file man- 
ager static storage added, solv- 
ing some of the problems that 
the next section deals with that 
exist on OS-9/68K. 

What is the downside of writ- 
ing your own file manager ? 
There are four problems that 
cause the most aggravation. 

The first is the very large 
amount of information that 
must be considered before 
coding begins. Start by design- 
ing the data structures and 
define how simultaneous ac- 
cesses to drivers are to be arbi- 
trated. Then consider the 



needs of the driver and its op- 
eration, and start coding Open. 
Create, and Close first. It is 
useful to create a 'null' driver at 
this point and test what you 
have. Debugging can be quite 
effectively carried out via 
Microware's system state or 
ROM debuggers, or through 
messages output to a terminal. 

The second problem is con- 
cerned with overflowing data 
structures. Both the path de- 
scriptor and the process de- 
scriptor overflow quite quickly. 
The path descriptor overllows 
simply due to the amount of 
path-specific data needed to be 
stored by complex file manag- 
ers. Storing a pointer to extra 
storage allocated from system 
memory in the path descriptor 
takes care of that. The process 
descriptor stores the process 
system stack and C programs 
arevery stack-hungry. An over- 
flowing system stack usually 
manifests itself in the form of 
weird errors and random sys- 
tem crashes. The solution is to 
maintain a pool of large stack 
buffers and transfer the stack 
on entry to and exit from the file 
manager. 

The third problem involves 
memory management and error 
handling. In system state (your 
file manager code is running in 
system state) memory alloca- 
tion is attributed to 'the sys- 
tem', not to any individual proc- 
ess. Any memory not returned 
to the system is lost forever ! 
Error handling, unless very 
carefully thought out. can re- 
sult in lost memory. You have to 
write your own memory alloca- 
tion routines, and it is worth 
having a method of logging all 
memory allocated by the file 
manager (via a linked list] in the 



68 Micro Journal 



JanJFeb. "90 



29 



path descriptor, so that when a 
path is closed an error can be 
generated, and/ or the 'lost' 
memoiy can be returned to the 
system. 

The fourth problem is that 
static storage and initialised 
data are not allowed. This has 
three implications. The first 
implication is that many of the 
standard C library routines use 
initialised or static data and 
therefore cannot be used. Any 
ROF that contains a function 
with such needs makes the 
whole ROF unusable. The only 
way around the problem is write 
your own library routines. The 
second is that your code cannot 
contain some constant arrays, 
such as arrays of pointers. The 
third is that the Jump table 
(automatically created by the 
linker for branches over 32K) 
cannot be used. The various 
parts of a large file manager 
have to be carefully arranged, or 
some alternative calling tech- 
nique employed (an array of 
pointers to functions for in- 
stance). 

Once you have written your 
first file manager, the second 
one comes much more easily. 
You have the assembly lan- 
guage interface and library of 
routines for accessing system 
calls written, and you have the 
experience behind you. You do. 
of course, still have a pile of 
documentation to complete.... 



Pile Manager Suppliers 



In North America contact: 
Steven Weller at Windsor Sys- 
tems (U.S.A) +1 (502) 425 9560 
(voice) + 1 (502) 426 3944 (fax) 
for file manager and driver writ- 
ing services. MFM. SPF. WRF. 
MSF. IBF. PC9. Logio and 
Gksman. 

In Europe contact: 
Paul Dayan at Galactic Indus- 
trial (England) +44 (582) 
405759 (voice) +44 (582) 
450324 (fax) for file manager 
and driver writing seivice. SPF. 
WRF. MSF. MFM and IBF. 
John Poulter at Snowtop Com- 
puters (England) +44 (582) 
45 1084 (voice) +44 (582)20764 
(fax) for Gksman. IBF and MFM. 

John Withers at Quin Systems 
(England) +44 (734) 771077 
(voice) +44 (734) 776728 (fax) 
for PC9. 

In Japan contact: 
Toshikuni Osogoe at Osque 
Systems (Japan) +81 (3) 220 
0384 (voice) +81 (3) 220 0417 
(fax) for IBF and MFM. 



FOR THOSE WH 




68 MICRO 



JOURNAL 



TM 



30 



Jan./Feb. '90 



68 Mcro Journal 



Forth 



A Tutorial Series 



By: R D. Lurie 
9 Linda Street 
Leominister. MA 01 453 



GETTING STARTED IN FORTH 



While the proliferation of versions of Forth has the 
advantage of supplying something for just about every- 
one, it does leave a lot of confusion in the mind of a 
beginner. It is possible to find a Forth which will run on 
just about any machine with just about any operating 
system. In most cases, any Forth you might choose 
would be satisfactory; therefore, I don't see that there is 
much room for argument, here. Under these circum- 
stances, my recommendation is that you get the Forth 
which fits your favorite operating system and start 
having fun! 

Some of the possibilities aie listed in Table 1 . This is not 
meant to be an exhaustive list by any means, but it does 
list those Forth versions that I have tried personally. 



local FIG chapter; we spent a whole meeting session 
working on it. Particularly, I want to thank Dick Miller 
of Miller Microcomputer Services for helping me get 
started with the list. 

The categories within the list have been arranged in 
alphabetical order and there is some grouping within 
each category, but I doubt that any group of words 
within the list is really more important than another, 
unless you have special programming requirements. 

I will discuss the categories in the order in which they 
fall in Table 2. 

Arithmetic words: 



Once you get your Forth, you will probably be 
swamped by the several hundred words at yourdisposal 
in the various vocabularies. Don't be intimidated by 
what looks like a lot of memorizing for you to do. Many 
of these word are used only for special cases which you 
may never encounter; there are words which I have 
never used and never felt the need for, so just relax and 
,L go with the flow." 

You will find that you will need about 45 words imme- 
diately. The rest can be learned as you need them. This 
minimum list can be found in Table 2. 

I am sure that I have left out some of the favorite words 
of those of you who have been writing Forth programs 
for a while, but remember that this is a list of the 
MINIMUM requirement, and not any particular list of 
favorites. This list was generated with the help of the 



Notice, first, that these are all words directly related to 
16-bit integers. We felt that the beginner would have 
little or no need for 32-bit arithmetic, so those words 
could be learned later. 

The use of the first four words, + - * and / , should be 
obvious to anyone who has ever written even the 
simplest program in any language; however, the others 
may not be as easy to grasp. 

MOD is the remainder after an integer division and is 
usually lost if you don't make a special provision to 
retain it. Remember that in integer division 6/3, 7/3, and 
8/3 all have the save quotient of 2, so you must make 
provision for saving the remainder if you need it. MOD 
saves only the remainder from the division, while / 
MOD (pronounced "slash mod") saves both the quo- 
tient and the remainder. 



68 Micro Journal 



Jan. /Feb. '90 



31 



*/MOD is a special case of a combined multiplication 
and division operation which makes use of a 31 -bit 
intermediate product. This helps maintain a greater 
accuracy in the results, but you have no access to the 
intermediate product. If you don't know when you will 
need this word, then you probably don't need it! 

NEGATE and ABS are not complementary just be- 
cause they operate on the sign of a number; therefore, 
don't be too complacent with them. NEGATE leaves 
the two's-complement of a number, which means that 
you could be surprised at the result of NEGATE oper- 
ating on a number which is already negative. On the 
other hand, ABS simply takes a signed number and 
makes it act as an unsigned number, which is not 
necessarily the same as converting a negative number 
into a positive number. In other words, these two 
operations can bite the hand of the unwary! 

MAX and MIN , which compare the top two 16-bit 
numbers on the Data Stack and select the higher mag- 
nitude or the lower magnitude, respectively; the other 
value disappears from the stack. I think that it is a valid 
assumption that, if the two numbers are the same, then 
one is simply erased. The action of MAX and MIN is 
relatively obvious when you realize that each word acts 
on a pair of signed numbers to return the M AXimum or 
MINimum of the pair. 

Comparison words: 

These are the simple "less than", "equal to", or "greater 
than" functions for determining the relative magnitude 
of a pair of signed numbers. In contrast to MAX and 
MIN , < , = , and > return a boolean flag replacing both 
numbers, so you better be sure to save them either on the 
Data Stack or in variables befoie you make the compari- 
son if you expect to have any further use for either one. 

Control structure words: 

Forth has a number of additional control structures, but 
we felt that the ones in the list could be used, in 
combination if necessary, to satisfy any common re- 
quirement. 

Consider the possible forms a control structure can 
take: 



l-l I. Either/or controlled by IF... ELSE... THEN 

l-l 2. Definite loop controlled by DO ... LOOP 

l-l 3. Indefinite loop controlled by BEGIN ...UNTIL 

What other types of decision could one make? Any 
otherdecisions must be variations on one of these three 
basic types. 

Probably, the most commonly used control would be 
the IF ... THEN or the IF ... ELSE ... THEN form. In 
either case, the most accessible number on the Data 
Stack will be used as a boolean flag to control the flow 
of the program; this flag is lost in the test for true/false 
so it cannot be used later. A true condition (any number 
not equal to 0) causes the words after IF to be executed; 
once all of these words have been run, control jumps to 
the first word following THEN . If ELSE is present, a 
false condition (a 0) causes the words following ELSE 
to be executed. When the ELSE words have all been 
run, or if there is no ELSE phrase present, then opera- 
tion jumps to the first word past THEN. 

I found this to be confusing when I first started working 
with Forth, since I had been using FORTRAN and 
BASIC, but I had very little trouble remembering to set 
the true/false befoie the IF , rather than after it. Once I 
got that straight, I had no more trouble with this struc- 
ture. 

The other two control structures are examples of a 
definite and an indefinite loop. The DO ... LOOP is a 
definite structure in which you know how many times 
the loop will be executed before you ever enter it, but 
the BEGIN ... UNTIL is an indefinite structure because 
it is executed until a true boolean flag appears on the 
Data Slack; if the flag weie always false, then the loop 
would run forever! 

One of easiest things to forget when setting up a DO ... 
LOOP is the proper order for the numbers defining the 
loop limits. You must put the end-value first and the 
start-value second (after all, this is an RPN system!) or 
you will get a surprise! It still happens to me, some- 
times, and I can usually laugh at the result, but not 
always. It is occasionally hard to lemember what value 
to use for the end-value; simply add the desired number 
of iterations of the loop to the value of the start-value. 
You will get 10 iterations from 10 and 0,5 and -5, or 123 
and ) 13; the only significance to the actual magnitude 



32 



Jart./Feb. '90 



68 Micro Journal 



of the starting limit is whether or not you want to use the 
internal loop counter for calculations. 

You can access the internal loop counter with the word 
I (pronounced "eye"). I always refers to the counter for 
the current loop, so be sure which counter you want 
when you are working with nested loops. 
The default stepping rate for the DO ... LOOP is + 1 , so 
you must use a different form if you want a different 
rate. This form is DO ... n +LOOP , in which the "n" is 
the magnitude of the step, it can be any value, except 0, 
and have either a + or a - sign. If "n" is negative, be sure 
your start value and end value are in the proper order! 
Also, remember that you must use +LOOP even when 
"n" is a negative number. 

As I said before, the BEGIN ... UNTIL loop can run 
forever if you don't pay attention to how you set it up. 
The indefinite loop is abandoned only when the Data 
Stack contains some value not equal to just prior to 
execution of the UNTIL .This number acts as a flag, so 
it is consumed by the test done by UNTIL; therefore, if 
you want to use it somewhere else, be sure to DUP it. 
You can achieve an infinite loop by writing a definition 
which ends ... UNTIL ; . Since this forces the flag 
tested by UNTIL always to be FALSE, the loopingwill 
beinfinite.sothisisoneofthecommon ways used to set 
up the outer shell of a program such as an editor, in 
which you want to keep repeating the main routine. 

Data Stack words: 

Of course, very nearly everything that you do in 
FORTH makes at least one manipulation of the Data 
Stack, sodon't confuse that fact with the present discus- 
sion. What I have in mind here are just those words 
which do nothing but operate on the Data Stack. 

DROPremoves the top numberfrom the Data Stack and 
DUP duplicates the top number on the stack. SWAP 
exchanges the top two numbers on the Data Stack. 
OVER can be a little confusing at first, but it can be 
thought of as a DUP somehow performed on the num- 
ber next to the one which was on top of the stack. 

ROT is something like SWAP , except that it works on 
the third integer on the Data Stack. This integer is 
simply moved into position so that it becomes the first 



number on the stack. The two integers which formerly 
were the first and second numbers now become the 
second and third, without their order being changed. 

Each of these words affects the count of the numbers on 
the Data Stack in this way: 

l-l DROP removes one integer from the Data Stack. 

1-1 DUP adds one integer to the Data Stack. 

1-1 OVER adds one integer to the Data Stack. 

1-1 ROT does not change the count of integers on the 

Data Stack. 

1-1 SWAP does not change the count of integers on the 

Data Stack. 

Defining words: 

This sounds rather formidable, since many FORTH 
books make a big deal about how easy it is for one to 
create new defining words which extend FORTH in a 
multitude of directions (all at once?), i think I under- 
stand enough about "defining words" to believe that 
most of them are of no use to the beginner, although an 
expert FORTH programmer delights in using them (I 
am not an expert!). At least 99% of my FORTH pro- 
gramming uses only four words which fall into this 
category, and they are listed in Table 2. 

You must use the : to open a definition and the; to close 
a definition. That is about it! 

The only other words which most people use exten- 
sively are CONSTANT and VARIABLE , which are 
technically "defining words", but already exist in the 
FORTH vocabulary, so you don't have to worry about 
them. 

If you don't understand how to write your own "defin- 
ing words", don't worry about it; you may never even 
care! For now, skip those chapters and read them later, 
if you ever have the time or feel deprived. 

Input word: 

KEY is the only input word a beginner really needs to 
become comfortable with, even though there are other 
input words contained in the various standards. 



68 Micro Journal 



Jan. /Feb. '30 



33 



KEY simply takes one character from the input stream, 
usually the keyboard, and puts it onto the Data Stack. 
Anything else that happens from then on is up to the 
programmer. As a result, KEY can be the foundation for 
building very elaborate input structures which should 
cover all of your needs. 

Logic words: 

Forth logic is usually at the bit level, so that AND and 
OR are always "bitwise" operations. You must remem- 
ber that in order to avoid confusion. I won't spend time 
on AND and OR , since they are standard throughout 
Forth and "bitwise" operations are simple to under- 
stand. 

Memory access words: 

Most memory access is done as 8-bit or 16-bit units in 
Forth, although there are exceptions. The only impor- 
tant consideration which might not be obvious is that 
storage of an 8-bit value ( C! ) into memory is done from 
the B Accumulator and not the A Accumulator with the 
6800 and 6809. People who are used to writing Assem- 
bly programs usually use the A Accumulator for most 
of their fetch and store operations, so they must keep 
this difference in mind with Forth. 



Output words: 

Only four words should satisfy a beginners needs for 
output, including formatting hardcopy. Simply put, . 
(dot) prints the numerical value of the integer on top of 
the Data Stack, and ." (dot-quote) prints the string 
pointed to by the integer on top of the Data Stack. 
Actually, the action of each is a little more complicated 
than that, but that is what you need to know to get 
started. 

CR just sends out an "end-of-line" signal, which is 
usually SOD, but might be something else if the DOS 
needs it. 

EMIT sends out the ASCII equivalent of the integer on 
top of the Data Stack. For example, if $41 or (decimal 
65) were on top of the Data Stack, EMIT would send out 
an A. 

Other words: 

I have not included Editor, Assembler, or Disk I/O 
words, since they are too dependent on the machine and 
the DOS that you are using. I assume that you either 
know how to use them, already, orelse don't need them. 



An 8-bit fetch ( C@ ) operation for the 6800/6809 
places the value into the B Accumulator and clears the 
A Accumulator, thus immediately promoting the 8-bit 
value into a 16-bit value. This can also cause problems 
for Assembly programmers if they don't keep it in 
mind. 

Misc. & System words: 

WORDS , known as VLIST in Fig-Forth, is important, 
since it shows you the defined functions you already 
have at your disposal. This command is often used in 
conjunction with FORGET . 

FORGET removes the indicated word AND ALL 
FOLLOWING WORDS from the dictionary, so that 
they are not available for use. Therefore, you should 
make a habit of checking with WORDS before using 
FORGET, so that you can avoid unpleasant surprises. 



34 



Jan. /Feb. '90 



68 Mao Journal 



Table 1 . The 


6800/6809 


Forths which I have success 


fully 


used. 


Operating 
Processor 


System 


Source 




Type 


6800 


none 
RAM 

disk 


Forth Interest Group 

P Box 8231 

San Jose, CA 95155 




Fig-Forth 


6809 


FLEX 


Forth Interest Group 

P Box 8231 

San Jose, CA 95155 




Fig-Forth 


6809 


CoCo 
tape 

or 
disk 


Stearns Electronics 
c/o South East Media 
5900 Cassandra Smith 
Hixson, TN 37343 


Rd. 


Fig-Forth 

with 
Forth-79 
additions 



6809 



FLEX 



Wilson M. Federici 
1208 NW Grant 
Corvallis, OR 97330 



Forth-83 



6809 



OS-9 
Level 
I or II 



D. P. Johnson 

7655 Cedarcrest Street 

Portland, OR 97223 



Forth-83 



Table 2: The minimum tisi of words a Fort!) beginner should leam. 



Arithmetic: 


+ 
/ 

ABS 
MIN 


MOD 
♦/MOD 
NEGA1E 
MAX 


/MOD 


Comparisons: 


< 


= 


> 


Control Structure: 


IF 
DO 

BEGIN 


ELSE 
I 
♦LOOP 

UNTIL 


THEN 
LOOP 


Data Stack: 


DROP 

DUP 

SWAP 


OVER 
ROT 




Defining Words: 


CONSTANT 


VARIABLE 




Input: 


KEY 






Logic: 


AND 


OR 




Memory Access: 


CI 


@ 
C@ 




Misc. & System: 


FORGET 


WORDS (VLIST ) 


Output: 


CR 

EMIT 


t» 





FOR THOSE WH 




68 MICRO 
JOURNAL 



TM 



68 Mcro Journal 



Jen ./Feb. '90 



35 



OS-9 And 






Recently I had the opportunity to 
test the Professional version of OS-9 
for the Macintosh computer from Ul- 
trascicncc. As a magazine deeply in- 
volved (more so than any other) with 
OS-9 and 1 personally being one of the 
oldest OS-9 users (In the early days of 
OS-9 each user was assigned a serial 
number, mine is #5) 1 appreciate OS-9 
as being a leading-edge product and 
have used and supported it as long or 
longer than probably any other user. 
OS-9 for the Real-Time Mac, 

b >' Ullras : Mtiltt-Uscr 

cicncc is a wel- 
come port. Multi-Tasking 

This is the 
first Mac OS 

that is capable 

IC^r" ™ s MS"* Into 

& multiuser operation. 
1 can only icport to you 
that it works, and give 
yousomcinsight ofwhat 
it is like on the Mac. It is available for 
the Mac Plus. SE, Mac II scries and SE/ 
30. T1r.it accounts for the three cur- 
rently most popular 6XX XX CPUs. The 
6X000. 68020 & 68030, The version 
we tested was for the Mac II with the 
6X020 CPU. 

Installation was the most simple 
OS-9 installation 1 have ever done. 
Basic requirements arc a Mac with 1 
meg of RAM and a hard disk with at 
least 5 meg of free space. You just 
create a folder on the Mac and drag the 
supplied programs from the Mac 3 1/5" 
drive to the Mac folder. Ilic simplicity 
is a result of this version of OS-9 mn- 
ningas an application. The Mac OS and 
Finder arc still in control of the hard- 
ware. While this slows the overall 
operation of OS-9 down somewhat, on 
our Mac 11 it is still fast. Compared to 



The Macintosh 



» po 

Mac 



our6X020Mustang ,M from Data-Comp 
running Professional OS-9. the differ- 
ence was not objcctional but was ap- 
parent. However, it is a very well done 
project, mainly because OS-9 was de- 
veloped and tuned to the 68XXX scries 
of Motorola CPU devices. Meaning, 
this port of OS-9 is well suited for the 
Macintosh sciics of computers. 

After you have copied the pro- 
grams to the Mac you then go through 
a short scries of steps to preparing OS- 
9 to run. You will be initializing the 
OS-9 hard disk (up to seven 
hard disk devices arc sup- 
ported.) 'os9sclup' is then 
edited changing the boot 
file to the newly created 
/h0, and away you go. 
One thing to be aware 
of. If you anticipate a change or up- 
grade to your Mac you will have a 
problem as OS-9 for the Mac checks 
for your serial numhcrandCPU type. If 
they do not match the CPU type and 
serial number you furnished Ultras- 
cicncc it will not run. This is one of the 
few Macintosh applications that uses a 
copy protection scheme. 

The floppy disk is supported only 
forthc M ac format in the version tested. 
Ultrascicncc promises floppy support 
for the OS-9 formal in the near future. 
However. Kcrmit is supplied so that 
files may be ported between the Mac 
and other OS-9 systems. When the 
lloppy drivers arc available we will let 
you know. 

The Mac printer port is designated 
/tl and the modem is /t2. Additional 
serial ports arc supported. The Macin- 



tosh monitor is designated /qdl. 

OS-9 has matured over the years to 
one of the most popular development 
and applications engines available 
today. It isvcrycompatiblcwith UNIX, 
especially at the "C" source level (the 
full feature Microwarc C.) I have seen 
thousands of lines of UNIX C directly 
com pi led to OS-9 without any changes. 
That means that most all UNIX appli- 
cations can be ported to the Mac and 
run under MAC70S-9 from Ultras- 
cicncc. Not to mention the hundreds of 
applications listed in the latest Microw- 
arc software catalog. Other languages 
supported arc BASIC. Fortran. Mod- 
ula-2. Forth. MUMPS, assembler and 
Informix software products. To just 
mention a few. li also supports the Mac 
toolbox. QuickDraw and ApplcTalk. 
It's well suited to robotics and process 
control applications. Because of it's 
case of porting, this should enhance the 
Mac as ascrious multi-user. multi-task- 
ing system. Now. what arc you waiting 
Tor? 

Additional information can be 
secured from: 

Ultrascicncc 
Oibbs Laboratories. Inc. 
1X24 WilmctlcAvc. 
Wilmcitc. IL 60091 
Tcl:3 1 2 256-OOXO 
Fax:312 256-0097 

DMW 



EOF 



36 



Jan-'Fob. '90 



68 Micro Journal 



a 



Mac-Watc 

For Those 

Needing to 
Know! 




68 MJ 



The Macintosh™ Section 



Reserved as 



nm i 

LURJJ 

A ptace for your thoughts 
And ours 

( Mac- c Watch 



CttT-ict : Ulrasrt ISA 

40 Eisenhower Drive 
Paramus, NJ 076S3 

li isn't oficn that a new software product comes along that has 
the potential to change the way traditional desktop publishers 
handlcdisplay typesetting. However, a rather unique product from 
Lcirasct® has changed all that - LciraStudio. 

There arc several other programs that can change the way a set 
of characters can be modified to suit the typesetters needs, but 
this application has them beat by a country mile! f could 
spend pages attempting to tell you what all this program 
does, however, as some Chinese fellow once said, "A 
picture is worth a thousand words, or so." 

The centered logo was originally a tutorial 
exercise in LciraStudio and was different in many 
respects. But, with just a couple of hours of 
learning LeiraSudio 1 was able to transfoim it 
into a usable logo for our use. On the next page 
ate a few samples thai should give you an idea of 
the power and uli lity of LciraStudio. Most of ihc 
examples on the next page were done in just a 
few (1-5) minutes or less each. 

One of the few negative, but impoitant, 
things about LciraStudio is that you arc con- 
strained to using their fonts. Of which only two 
arc included with the program. Two more fonts arc 
sent to the buyer upon receiving the registration card, 
and if you happen to have bought some other of their 
products you might receive two or three moic. How- 
ever, 1 am not sure that policy still holds. 

The price of fonts to add to your font portfolio for LciraStu- 
dio is rather steep, on the order of about $75.00 per font. So, 
expanding your font selection could taisc the price rather sharply. 
However, if you have ever used some of the other font "fiddling" 
appl ications avai lablc to the Mac user, you will find that ease of use 
and time saved (which can be a major part of end- product cost) is 
well within reasonable limits. All in all, I feel that even with the 
additional cost. as needs arise, this is an outstanding addition toany 
collection ofdcsktoppublishing tools! And that my friends is from 





the "Cranddaddy of desktop publishing." 

Yes, I (and the staff here at 68 Micro Journal) are finally 
getting recognition as the folks who were the first to use desktop 
publishing commercially orothcrwisc. For over eleven 
years this magazine has been completely typeset 
and laid-out using traditional desktop publish- 
ing ha rdwarcand software. Years before Apple 
ever thought of the Macintosh or desktop 
publishing. It wasn't called desktop pub- 
lishing then, that word was coined later. 1 
was just the first to start using it as a 
complete micro-computer system, 
printer and all. What 1 started with was 
crude as compared to what 1 am using 
today, but it was all on the desktop and 
I made it commercially available (sys- 
tems sold here in the USA, Canada, 
Mexico, South America and Europe.) 
Using a SWTPC kit (6800) a self- 
modified ball typewriter and later a 
daisy wheel printer and print drives and 
editing software 1 wrote (later other com- 
mercial software, computers and printers) 1 
was able to do the first issue of 68 Micro 
Journal completely on the desktop, all the way from 

input (editing, layout, etc.) to the process of pasteup. And we still 
do it today! Not any other international publication can make that 
statement! - Now, back to LctraStudio. 

The nice thing about this program is that you don't need to be 
an expert to use it. It issimplc to learn and above all , fun. The results 
ate truly amazing. The documentation is easy reading and very 
thorough. 

Text can be altered in "line, envelope or straight" mode. Also 
text can be typed around a circle. 



mm% 



A WARD WINNING 
reporting & Reviews 



69 Micro Journal 



Jan./Feb. '90 



37 



"Line mode" allows one or more lines of text 10 be distorted 
along the base line, "envelope mode" allows text and shapes 10 be 
grouped into an envelope and distorted together as a unit. The 
envelope may also be moved as a unit , Text within an envelope may 
not be altered. However, the envelope can be removed, text 
changes made and the envelope reinstalled. The circle choices are 
inside or outside the circle. With a combination of these functions 
an unl imitcd number of objects can be created. The examples (next 
page) arc but a smattering of what can be accomplished in just a 
short time. 

Another shortcoming of LctraStudio is the way that objects 
you create can be exported to other applications. If you use only 
applications that can accept an EPSF you will have no problems as 
LctraStudio provides an export function for that typcof f ilc. How- 
ever, it cannot open an EPSF file, so you arc required to save in 
LctraStudio format also if you intend to ever open the file again. 
Text objects in straight or line mode may be saved to the clipboard 
and used as a normal Mac operation. However, objects that arc de- 
veloped in an envelope arc only exported as EPSF flics. This places 
a burden on the user who uses programs that only accept PICT or 
bitmapped objects. For the professional this is less a burden as he 
probably has and uses the more expensive applications thai import 
EPSF files. It is hoped thai this as well as the fomcosi problem will 
be addressed in an upcoming revision that is slated to be released 
this fall. Text files from other applications cannot be imported, 
leaving the user to use only LetraS- tu- 













Zmputer****** 



inc- 




O^iRI^PPiD 



P«4 

«** 

fUM S 

*££4r*(rvcr, mtSJ|nishcd 

FOR THOSE WH 



LctraStudio files may be exported to other applications and there 
additional text or other objects added. 

LctraStudio has most of the normal text and graphic tools and 
functions found in other similar applications (pointer, text, zoom 
and graphics.) The zoom tool allows a wide range of magnification 
plus or minus. Graphic tools include lines, arcs, circles and rec- 
tangles. Page templates arc supported. Objects (bit mapped or 
PICT) also may be imported and used as templates to set precisely 
objects being developed in LctraStudio. Grid lines may be dis- 
played and sized, snap to grids can be turned off or on. grid/guide 
lines may be set to any angle for precise text alignment. The ruler 
can be set off or on and may also be scaled and set to inches, 
millimeters or points (the typesetters system of type measure- 
ment.) The ruler cannot be zeroed, which I hold a minus. Also only 
three sets of guidelines may be on the screen. The work aica is 28 
inches square, I find that more than adequate. Crop marks arc 
supported and may be placed by the user as he desires. For those 
having a high resolution monitor, tonal information may be dis- 
played, making things a lot nicer. A prcf file is suppoitcd. Text 
keming is supported and overlapping one side or the other is 
another nice feature. Objects or lines of text may be rotated by 
selected degrccsor by the free-hand method. Many of the functions 
and operations are supported by keyboard input using the com- 
mand and option keys in conjunction with other keys. 

The distortion functions are menu derived and allow for 
almost endless alterations to text or envelope objects (linear 
scaling &. distortion, horizontal and vertical, curvilinear distor- 
tions also cither horizontal or vertical.) Bczicrs controls are sup- 
ported on lines and objects. Sec examples. 

Fills may be by percent of white, black, none or Pantonc 
designation. Stroke lines and arcs have a choice of round, butt or 
projected caps. Rectangles may have round, bevel or m itrecomcrs. 

Duplications arc supported to a high degree. You can produce 
complex effects with case and even select number of duplications 
and offset amounts of each duplication, as well as order of dupli- 
cation (behind or in front) in one operation. Duplication works on 
objects, graph ic objects, lines of lex land the contents of en vclopcs. 

Printing is normally assumed to be directed to a Postscript de- 
vice, however, Quick Draw printers arc supported, but mostly at 72 
dots per inch. 

I found it to be everything advertised. And to sum it all up - "I 
wonder how we ever got along without LctraStudio?" For the 
desktop publisher, professional or otherwise, I give it my unquali- 
fied approval. 

DMW 




68 MICRO 
JOURNAL 



TM 



38 



JanJFab. '90 



eaUcro Jourorf 



Message Passing Protocol 



CompconuoJ BV 
Stralumsedijk 31, PO Box 193 
5600 AD Eindhoven 

Intelligent Peripheral Controllers, Cuts VMEbus Loading 



By: Ing. J.H. Brand and Ing. L. dc Graaf 

Standardizes Interface Between 



Although the most obvious and popular 
way of increasing the power of VMEbus 
systems is lo add processor boards, this can 
cause problems unless ihcsystcm architec- 
ture ;is well thoughtoui. Just adding proc- 
essor boards can crowd out the bus, and 
degrade system response times. For ex- 
ample, a VMEbus system with twenty 
processor boards can by definition only 
allow each processor an average bandwidth 
of 1.5 Mbyte s/s. Dcsigncrscannotaffordio 
have this banwidth taken up by routine, 
low-level communications. 

Incorporating intelligent peripheral 
conirollcrsiniothcsysicmcan alleviate bus 
loading, since data can be processed on the 
boards licforc passing it across the bus. 
Disk handlcrscan for example return sorted 
lists of disk contents rather than transport- 
ing large data blocks across the bus for the 
host processor to sort. Intelligent interface 
boards, industrial control, and image proc- 
essing boards can all similarly increase 
overall system performance. 

Such intelligent peripheral controllers 
can. however, bring their own problems. 
Each board requires its own driver, and 
designers have to write the software rou- 
tines that allow processors to communicate 
with thcconirollcrscfficicnily and reliably. 
If there arc several peripheral controllers, 
this is no simple task, and strikes at the 
major advantage of the VMEbus itself: 
standardization. And without a well de- 
fined and orderly message handling proce- 
dure, designers will find it very difficult to 
trace the cause of any system lockups that 
may occur during run-time. 

To solve these problems, Compcontrol 
BV (Eindhoven, Ihc Netherlands see ad- 
vcrtismcni on the inside back-cover) has 
written a Message Passing Protocol which 
standardizes communications to its own 
range of intelligent peripheral controllers. 
It is now making this protocol freely avail- 
able to VMEbus manufacturers and users, 
who can take advantage of the protocol to 
reduce the load on uansmiuing processors. 



It does this by concentrating arbitration and 
communications overheads associated 
with data transfers within the receiving 
peripheral controllers themselves, thus 
freeing the system processors to carry on 
with their own tasks. 

The simple method of communication 
makes the protocol viitually hardware in- 
dependent: the transmitting and receiving 
boards communicate with each other using 
cither interrupts, ora mailbox. A transmit- 
ting processor needs only a few bytes of 
RAM (for storing address pointers) that can 
be accessed by both the processor and the 
VMEbus. Similarly, the receiving proces- 
sor needscnough dual-access RAM tostorc 
a single message; a DMA controller can 
increase the efficiency of VMEbus traffic 
in large multiprocessing systems. 

Updating The Queue 

At system initialization (Fig. 1 ), each re- 
ceiving board has a queue consisting of 
only two entries (the QHPand QTP). Both 
these entries point to the same NULL 
message, Which tells the receiving board 
that no messages are pending. 

After initialization, a message is added 
to the queue as shown in Figure 2. A trans- 
mitting processor (MPU I ) copies the exist- 
ing NULL message into its own RAM (at, 
for example, address I ICXX)). Then, it 
updates the receiving board'sCP topoint to 
its own message (10000), and updates the 
NMP to point to the new NULL message 
(now ] I (XX)); the pointer to the new NULL 
message (11000) is written at the QTP. 
Finally, it generates a local interrupt to 
inform ihc receiving board that the queue 
has been updated (the receiving board then 
does not need to poll the message queue). 
Figure 3 shows the effect of queuing an- 
other message ( adding yet one more mes- 
sage would bring the system into the state 
shown in Fig. 4). 

A transmitting processor docs not need 
to wait for a message to be handled before 



sending a second. The only proviso is that 
the message queue must be updated as an 
individisiblc cycle; cither the sending 
processor keeps control of the VMEbus for 
four cycles when updating the message 
queue, or it sets a semaphore which pre- 
vents access to the Queue Tail Pointer. 

Removing a Message 
From The List 

To remove a message from the list, a re- 
ceiving board reads the message address 
from its Contents Pointer (address 1 0000 in 
Figure 3). It then copies the message into 
its own RAM, and updates the NMP anCP 
registers (respectively replacing 1 1 OCX) 
with 2S0«0. and 10000 with 20000). The 
receiving board then acts on ihc message. 
Finally, the receiving board sets the NMP 
and CP to zero to allow the memory used to 
stoic the original message to be re-used, 
and informs ihc transmitting board that it 
has done so. 

A key feature of any message queue is 
what lakes place when a processor tries to 
access the last entry in the queue (there can 
be problems if ihc processor accesses the 
last entry in a different manner from other 
entries). As shown in Figure I, 
Compconirol's Message Passing Protocol 
informs a receiving board that no messages 
arc pending by the Queue Head Pointer's 
NMP holding a zero. 

Compconirol's MPP also has important 
side benefits, including simplifying system 
expansion. Each new transmitting proces- 
sor simply needs a copy of the protocol, and 
the address of the Queue Tail Pointer of 
each receiving board it will need to address. 
Each new receiving processor needsacopy 
of the protocol, and exclusive use of 
enough registers to hold the pointers (the 
transmitting boards must also be informed 
of ihc new board's existence, and the ad- 
dress of these registers). 



68 Micro Journal 



Jan. /Feb. '90 



39 



MPP Protocol 



Overheads for ihc MPP protocol arc 
low. Ihc initial queue can be established 
usingonly 4 long words, with each message 
addingan overhead of 15long words. The 
transmitting processor always accesses a 
receiving board's message queue in the 
same manner, which makes for simple and 
standardized software. The user can allo- 
cate his own priorities to the messages, and 
receiving boards can generate time-outs if a 
message is not handled within a prcdclincd 
period. 

A peripheral controller can act as cither 
a receiving or (if it has access to enough 
memory space for storing messages) a 
transmitting board. Messages can be stored 
cither in RAM on the transmitting board 
itself, or on disk somewhere in the system 
until Ihc receiving board is ready to act on 
them. The messages may be on any length; 
any number of processors can access a 
receiving board, and there is no limit to Ihc 
number of messages which can be queued; 
limits arc set only by the amount of avail- 
able memory to stoic the messages. 

Each receiving board has its own mes- 
sage queue, consisting of a header, com- 
mand block, data block, and status block. 
The fixed-size header gives the receiving 
board information such as the mailbox 
address (or alternatively which interrupt 
level and interrupt vector) it should respond 
to when the message has been handled. The 
variable-size command and data blocks arc 
followed by Ihc status block, which tells the 
board which action it must take if it cannot 
act on the message. 

A system's message queue is distributed 
around the transmitting boards. Each 
queue entry has two 32-bit words: one 
holds the address of the current message 
(the Contents Pointer, CP), and the other 
holds Ihc address of Ihc next queue entry 
(the Next Message Pointer, NMP). These 
queue entries therefore form a linked list; 
the final queue entry (called the NULL 
message) has an NMP of and a CP of - 1 
(an inaccessible address which indicates 
that there is no associated message). 

The only other reference addresses 
which the system needs to hold arc Ihc 32- 
bit addresses of the queue head (the Queue 
Head Pointer, QHP) and queue tail (the 
Queue Tail Pointer, QTP). These are both 
stored on the receiving boards. 

Ihc protocol can even help here, since it 



PEiiPnfnn coMROuffl 



OMP 



NMP 



1 16BB 



iBBBB 



CP 



OTP 



3S888 



can be used to teach peripheral 
controllers new commands. A 
transmitting processor could, for 
example, load application-spe- 
cific software onto a newly-in- 
stalled rccicving board using only 
a single instruction: "lcam new 
command." MPP also makes is 
very simple to trace the cause of 
the system lockups which arc 
inherent to multiprocessing sys- 
tems. Such lockups occur when 
one program is wailing for the 
results of another program, which 
in turn is wailing for the results of 
Ihc first program. With MPP, the 
relevant registers show all the 
system's pending messages. 

More information on the 
protocol (including a protocol 
description) is available from 
Compcontrol BV, Stratumsedijk 
31, PO Box 193, 5600 AD Eind- 
hoven, The Netherlands. 



PERIPHERAL CONIROUER 



OHP 


!■ 




NMP 


•Hf 




■• 




. 




OTP 


.1 




Et» 


lea 













TRANSMIT! ItiC MPUI 



MESSAGE » 



^ 



« J538B !- 



T¥l 



CP 



TRANSMITTING Mi=,i2 



M-SS»6E 2 *■ 



NMP 



3$e0B 



32888 



CP 



TRANSMITTING MPtJ3 



MESSAGE 3 



r 



NMP 



CP 



Figure 2: To add a messages to Ihc 
queue, a transmitting board copies 
the null message to a new location 
and updates the Next Message 
Pointer (NMP), Contents Pointer 
(CP) with their new values. Then, it 
updates the receiving board's Queue 
Tail Pointer. 



Figure 1: When a system is initial- 
ized, Ihc receiving board's Queue 
Head Pointer (QHP) point to the 
same location ( a NULL entry), 
which shows that no messages arc 
pending. 



Jin,/F«b. '90 



68 Micro Journal 



P{BlPMt»»L CONFROLlFR 



OHP 



nmp 



■" II BBS 



1BBBB 



CP 



DTP 



neea 



Figure 3: To add a subsequent mes- 
sage lo the queue, the procedure is 
ihc same as that shown in Figure 2. 



1 RJNiHI ITINti MPU1 


J2SJ ] 

MESSAGE t 


NI1P 
IP 


— 





PERIPHERAL CONiROUER 
OMP nmp 






















TRANSMITTING MPU1 








IDS 


if 


i ibob 












I 


• rti 
































| 




MtSSA&E 1 








£f 








OTP 






NMP 










15088 
















2SBBB 

29988 






























tP 






Figure 4: The linked list of message 
pointers in Compcontrol's MPP is 
distributed around the system. Each 
queue entry holds the addicss of the 
relevant message (the Contents 
Pointer), and that of the ncxicntry in 
the queue ( the Next Message 
Pointer). 






















TRANSMITTING MPUZ 






NESSAOf 2 


,'HH 










NMP 
















■ in 


e 


















-' 






(p 









FOR THOSE WHO 




68 MICRO 



JOURNAL 



■n*\ 



68 Micro Journal 



J on ./Feb. '90 



41 



CAREEN 68K brings I he power olOS-9/ 
68000 in your IBM- PC 

The high performance Add-ln-Boa/d CAREEN 
68K changes the character ol your PC Irom a 
simple documentalxsn tool to a powerful real- 
time software development system. 

II you want more informations, 
here is your contact address 

LP Elektronik GmbH 
Ettishofer StraBe 10c 
D-7987 Weingarten 
West Germany 

Telefax: (0751) 53199 
Telephone: (0751) 52327 



PROFILER 

Discover wbicb functions uitbio your 
C or Asseibly prograis take the lost 
tiie to run An invaluable 
development tool for anyone worried 
about prograi speed. 

For inforiation on this product 
and our other OS-3 software 
developient packages: IMP (the 
Intelligent Hake Prograi), STIBULUS 
(Artificial Intelligence Language), 
FAN UTILITIES and WINDOWS (source 
code library) contact:- 



]0o 



PAX CONTROLS L1HITID, 

Druiiore, Doune, 

D Perthshire, 

FI16 6AL SCOTLAND. 

Phone (H4I 78685-261, 



^^A tf^^Vi^^ WTT1 pnv^ ■ 

^P^Pl l*^* til —r+cm*. **±J&\ 

£0 \ Mm) OevetafimK, Mrtatfcn 
a^kw \ ol p w tfiim. tc/fv*. and 
cxirfitlt teuraradkn toe OEW*. Wt fm- 
dafaa In the totewtng MOTOROLA peAffr.- 

HARDWARE DEVELOPMENT 



■ 6805. 68HCI1, 68000/20 

■ Single Board Computers 

■ VMEbus systems 

SOFTWARE DEVELOPMENT 



■ Assembly Language 

■ UNIX 

ADICON 



CONSULTING 
AND DESIGN 



1123 N. WMat St., Whrai*»* Wl S32Q2 
414/276-6800 



r 



• HARDWARE DESIGN, BREAD80ARDING, 
AND PROTOTYPING 

•SOFTWARE DESIGN, PROGRAM ASSEM- 
BLY. AND FIRMWARE IMPLEMENTATION 

• INTERFACE DESIGN AND DEVELOPMENT 

• MICROCOMPUTER 8ASED MEASUREMENT 

AND CONTROL 

• DESIGN OF SINGLE CHIP MICROCOM- 
PUTER BASED PRODUCTS A SPECIALTY 



MICRODYNAMICS 

P.O. BOX 2716 
WARMINSTER PA 18974 



(215)-357 6805 



Fulfilling the needs 
of the nation's high lech 
community for over a 
decade. 

Leaders in Hardware 

and Software consulting for 

real-time military and industrial 

applications. 



Al Microsystems, Inc. 
One Napeivillc Plaza 
Napeivillc, II. 6OS40 
(312)416-2177 

Tomorrow's Technology Today! 



RADON 



Use Your Computer To 
Measure Radiation. 
Write Or Call For 
Our Sensor Catalog. 




For more tntormarion pieaie call or write. 

LaGrange Instruments, Inc. 

Kuchler Drive 

LaGrangeville, NY 12540 

(914) 223-3336 



ATARI ST 

059 Professional'" incl: 
C, Basic. Eniacs, Kermit, 
S record down load, OS9 to TOS transfer. 
Sculptor'"-, Dynacalc' - , Stylograph™ 

8 Serial Von board lor the MECA ST. 
12 bit Analogue I/O interface 
16 bit Parallel Interlace 
EPROM Programmer 

UNISON, 

T.J.P. Electronics Ltd. 
3 West Street, 
Scarborough, 
North Yorkshire, 
ENCLAND. UK. 
YOl I 2QL 



Tel U.K. 723-378837 
\ F AX U.K. 723-500435 



A 



dHPl/ITO PEREPitERIALS 

FDR THOSE WHO 

LIKE TO BUILD 

THEIR OWN. 

FDR MORE 

INFORMATION 

SEND A S.A.S.E. 

TO 

HARLEEN FRAfCISOO 
8332 PEOGY ST. 
TAMPA FL. 
33615 



r 



Mil 



ELECTRONICS INC. 

A NAME YOU'LL REMEMBER 

ROUTE 12 BOX 322 

INDIANAPOLIS, IN 46236 

(317)335-2128 

First to offer OS-9 
68000 on the STD Bus 
Full line of memory, 
serial, parallel, 
analog, digital, and 
video I/O. Full 
systems tool 



J ^ 



42 



JanJFeb. '90 



68 Micro Journal 



Classifieds 



A» Submitted ■ N« Cuaramccs 



SWT1' S/tW • 384 K, lOMcg Hard Disk, 8" 

Floppy, 2-X-12 Word Processing Tcnninuls, 

Fumilurc. Software. Paid $9(XX) in 1983, 

Stored since '84. 

Best Offer (618) 667-2544 
*** 

PT68008 Single Board Compuicr, 10 MHz, 2 
RS-232 Serial Pons, 768 K RAM/64K Eprom, 
1-5" Drive, 20 Meg Hard Disk, 2-8 Bit Parallel 
Pons, OS9, Stylo Pak, Sculptor. $1495 

CDS-- 1. 20 Meg Hard Disk w/controllcr$100 
S+ Memory Cards, CPU Cards, Hard Disks w/ 
Controller Cards. I/O Cards, Cabinets, Power 
Supplies. 

S/09 CPU Cards. Memory, I/O Cards. Controller 
Cards 

5-Sicmcns 8" Disk Drive, $100 ca 
Tom (615) 842-4600 M-F 9AM to 5PM EST 



J 



OS-9/68K 



FILE MANAGERS 



Eight Application-Specific OS-9 File Managers 

GKS High speed industrial graphics 

IBF To control IEEE-488 bus devices 

Loglo For dumb ADC, DAC and digital I/O 

MFM Manages memory and modules as a disk 

MSF Use MS-DOS formatted disks on OS-9 

PC9 Run multiple OS-9 processes from a PC 

SPF For intelligent serial, DAC, ADC boards 

WRF To control WORM optical disk drives 

We write OS-9 file managers, drivers, utilities, 

applications, systems and graphics software 

and sell system software tools. 

For additional information, pricing, a full product 
list or to order, contact Steven Weller. 

'OS-9' TMMicnjran lac.'MS-DOS' TM Mkrvsoft. 



uui ruir 



Windsor Systems 



2407 Urn* Kiln L&rw, LouMlto, KY 40222 US A 
Telephone, poaj 425 8860 Fax: (502} 426 2044 



FLEX™/SK-DOS™/MS-DOS™/Aiari™ 

Transfer Utilities 

For 68020, CoCo* Atari, OS-9 Systems 

Now READ - WRITE -DIR - DUMP- EXPLORE 

FLEX,SK-DOS & MS-DOS Disk 

These Utilities come with a rich set of options allowing the 

transfer of text type files from/to FLEX & MS-DOS disks. 

*CoCo systems require the D.P. Johnson SDISK utilities and 

OS-9 and two drives of which one must be a "host" floppy. 



CoCo Version: $69.95 



Atari $99.95 



68020 Version $149.95 




S.E. Media 

5900 Cassandra Smith Rd. 

Hixsun,TN 37343 

(615) 842-4600 FAX (615) 842-7990 




68 Micro Journal 



Jan. /Feb. '90 



43 



K-BASIC* 






The Only 6809 BASIC to Binary Compiler for OS-9 

FLEX or SK*DOS 

Even runs on the 68XXX SK*DOS Systems* 





■ — — « — \ 

Hundreds Sold at \ 
Suggested Retail: § 

i 

i 

i 

J 



• 6809 - OS-9™ users can now transfer their FLEX™ 
Extended BASIC (XBASIC) source files to OS-9, com- 
pile with the OS-9 version and run them as any other 
OS-9 binary "CMD" program. Much faster than BASIC 
programs. 

■ 6809 - FLEX users can compiler their BASIC source 
files to a regular FLEX "CMD* file. Much faster execu- 
tion. 

• 68XXX - SK'DOS™ users running on 68XXX systems 
(such as the Mustang-OS/A) can continue to execute 
their 6809 FLEX BASIC and compiled programs while 
getting things ported over to the 68XXX. SK'DOS 
allows 6809 programs to run in emulation mode. This is 
the only system we know of that will run both 6809 & 
68XXX binary files. 

K-BASIC is a true compiler. Compiling BASIC 6809 pro- 
grams to binary command type programs. The savings 
in RAM needed and the increased speed of binary 
execution makes this a must for the serious user. And 
the price is now RIGHT! 

Donl get caught up In the Team a New Language" 
syndrome - Write Your Program in BASIC, Debug it 
in BASIC and Then Compile it to a .CMD Binary File. 



For a LIMITED time 
save over 65%... 
This sale will not be 
repeated after it's 
over! * 



— — — — \ 

SALE SPECIAL: ■ 

$69.95 ! 



SPECIAL 

Thank-You-Sale 

OnCy from: 

~S.E. Media* 



c 



p 



I 



5900 Cassandra Smith Rd. 

Hlxson.Tn 37343 

Telephone 615 842-6809 



A Division of Computer Publishing Inc. 

Over 1,200 Titles- 6800-6809-68000 

FAX (615)842-7990 



• K-BASIC will ran under 68XXX SK'DOS in emulation mode far (he 6809. 

Price subject la change without notice. 



44 



JunjFob. '90 



68 Mao Jourhal 



THE 6800-6809 BOOKS 



OS -9 User Notes 

By: Peter Dibble 

Tlie pubis hers ol 66' Micro Journal are proud to make available the 
publication ol Peter Ofcbies 

0S9 USER NOTES 

Information lor the BEGINNER to the PRO. Regular or CoCo 0S9 

Using 0S9 

HELP, HINTS. PROBLEMS, REVIEWS. SUGGESTIONS, COMPLAINTS, 
0S9 STANDARDS. Generating a New Bootstrap. Building anew System 
Disk, 0S9 Users Group, etc. 

Programming Languages 

Assembly Language Programs and Interlacing; Basic09, C, Pascal, and 
Cobo) reviews, programs, and uses: etc. 

Disks Include 

No typing all the Source Listings n. Source Code and, where applicable, as- 
sembled or compiled Operating Programs. The Source and the Dca/ssians 
in the Columns can be used 'as is', or as a "Starting Point lor developing your 
OWN more powerful Programs. Programs sometimes use muhple Lan- 
guages such as a short Assembly Language Routine lor reading a Directory, 
wtuch is then 'piped" to a BasicM Routine lor output lonnatling. etc. 

BOOK $9.95 

Typesel — w/ Source Listings 

<3-HolePunched;8xii) 

Deluxe Binder $5.50 

All Source Listings on Disk 

1-8" SS, SO Disk $14.95 
2-5" SS, SO Disks $24.95 



FLEX USER NOTES 

By: Ronald Anderson 

The pubfctersol 68 MICRO JOURNAL are proud lo make available the pub- 
lication ol Ron Anderson's FLEX USER NOTES, in book torn). This popular 
monthly column has been a regular feature in 66* MICRO JOURNAL SINCE 
1979. It has earned the respect ollhousarvis ol 68 MICRO JOURNALreadeis 
over the years. In lad, Ron's column has been desotwl as the 'Bbie' for 
68X X users, by some ol the world's leading microprocessor professional s. The 
most needed and popular 68XX boo k available. Over the years Ron's column 
has been one ol the most popular in 68 MICRO JOU RNAL. And of course 68 
MICRO JOURNAL is the most popular 68XX magazine published. 



Listed below are a lew of the TEXT Ales included in the book and on 
diskette. Al TEXT riles in the book are on the disks. 



L0G0.C1 Fie toed program b offset memory - ASM PC 

MEMOVESCI Memory move program ■ ASM PIC 

DUMP.C1 Pmter dump program - uses LOGO - ASM PiC 

SUBTEST CI S*muta6onol 6800 code to 6809, show differences ASM 

TERMEMC2 Modem inpul todsk(o< oiher port input todsk) ASM 

M C2 Outpul a file to modem (or another port) - ASM 

PRINT C3 Parallel (Starved) printer driver - ASM 

MODEM C2 Til outpul lo CRT and modem (or other port) - ASM 

SCIPKG.Cl Scientific math routines -PASCAL 

UC4 Mim-moMO). disk resident, many useful fjrxaiorts - ASM 

PRINT.Cl Parallel printer dnver. without PFLAG - ASM 

SET.CS Set prater modes - ASM 

SETBASICS Set pnnier modes -A-BASIC 



Note: .C1, .C2, elc.=Chapter 1. Chapter 2, etc. 

" Over 30 TEXT files included is ASM (assembter)-PASCAL- 
PIC (position independenl code ) TSC BASIC-C, etc. 

Book only: $7.95 + $2.50 S/H 

With disk: 5' $20.90 + $2.50 S/H 
With disk: 8" $22.90 + $2.50 S/H 




Shipping ft Handling $3.50 per Book, $2.50 per Disk set 

Foreign Orders Add $4.50 Surface Mall 

or 47 00 Air Mall 

If paying by check - Please allow 4-6 weeks delivery 

' All Currency In U.S. Dollars 

Continually Updated In 68 Micro Journal Monthly 

Computer Publishing Inc. 

5900 Cassandra Smith Rd. 

Hlxson. TN 37343 

Telephone (615) 842-4601 




FLE X m indnuikol 1«*nei) StrMnni Conulinu 

OSS ■« indamut of Mcrswara and Motorola Tatai S10S0O6630 

56' Micro Joumslon Wdeirnil(otCoinpi«;Pvi*sr»^ kic 



FAX (615) 842-4607 



68 Micro Journal 



Jnn^Feb. '90 



45 



68 f Micro Journal 
Reader Service Disks 



Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Dbk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 
Disk 



1 Filesort, Minical, Mmicopv.Miriifms, "Lifetime. "Poetry. ••Foodlilt, "Diet. 

2 OiskadU w/ inst.A fixes. Prime. 'Pnnod. "Snoopy, "Football, "llexpawn,"Lifelime. 

3 Cbvg09. Sect, Sec2. Find. TiblcZ. Inicu. Disk-cap. •Diskrave. 

4 Mailing Prognun. 'Finddal. 'Change, •Tesidisk. 

5 'DISKFDC 1, 'DISKFK 2. "LETTER. "LOVESIGN. "BLACKJAK, "BOWLING. 

6 "Purchase Order. Index (Disk file endx). 

7 Linking Loader. Rload. Hatkncss. 

8 Cncit. Lanphcr (May 82). 

9 Daiecopy, Disklix9 (Aug 82). 

10 Home Accounting (July 82). 

1 1 Dissembler (June 84). 

12 Modcm6* (May 84). 

13 *lniimf68. Tcstmf68,"Clesnup. 'Dskalign, Help. Date Txt. 

14 •Intl, 'Test. •Terminal. 'Find, "DUkedit. Inil.Lib. 

15 Modem9 + Updates (Dec. 84 Gilchrst) to Modem9 (April 84 Commo). 

16 Copy.Txt, Copy. Doc, CalTxl, Cal.Doc, 

17 Match Utility. RATBAS. A Basic Preprocessor. 

18 Parse-Mod. SiicCmd (Sept. 85 Annsirong).CMDCODE. CMD.Txt (Sept. 85 Spiay) 

19 Clock, Due, Copy. Cat. PDRL.Aim A Doc.. Errots.Syi, Do. log.Asrn A Doc. 

20 UNIX like Tools (July & Sept. 85 Taylor A Gilchrist). Dragai.C. Grcp.C, LS.C, FDUMP.C. 

21 Utilities & Games • Date, Life, Madncn, Touch, Goblin. Stanhot, A 15more. 

22 Read CPM A Non-FLEX Disks. Fnuer May 1984. 

23 ISAM, indexed Sequential file Accessing Merfiods. Condon Nov. 85. Extensible Table Driven. Language Recognition Utility. Anderson Mar86. 

24 68' Micro Journal Index of Articles A Bit Bucket Items from 1979- 1985. John Current. 

25 KERM1T for FLI-X derived from Ihc UNIX vcr. Burg Feb. 1986. (2)5" Disks or (1)8" Disk. 

26 Compacla Uniftoard review, code A diagram, Butlison March '86. 

27 ROTABIT.IXT, SUMSIliST .TXT. CONDATA.TXT, BADMEN.IXT. 

28 CT-82 Emulator, bit mapped. 

29 "Star Trek 

30 Simple Winchester, Dec'86 Green. 

31 ••• Rrad/Wne MS/TCDOS (SK'DOS) 

32 lleir-UNIX Type upgrade - Feb .87 

33 Build the GT-4 Terminal -Nov. 87 Joseph Condon. 

34 FLEX 6809 Diagnostics. Disk Drive Test. ROM Test, RAM Test • Apr. 89Korpi. 

35 DO A FLEX -09 Batch File Processor • Oct. 88 • Dave (lowland 

36 Add Graphics To Your SBC - Nov. 88 - Joseph Condon 



NOTE: 
This is a reader service ONLY! No Warranty is offered or implied, they arc as received by 68' Micro Journal, and arc for reader 
convenience ONLY (some MAY include fixes or patches). Also 6800 and 6809 programs are mixed, as each is fairly simple 
(mostly) to convert to ihe other. Software is available to cross-assemble all. 

* Denotes 6800 - ** Denotes BASIC 
"* Denotes 68000 - 6809 no indicator. 

8" disk $19.50 
5" disk $16.95 

Shipping A Handling -U.S.A. Add: - $3.50 
Overseas add: $4.30 Surface - $7.0* Airmail 

68' MICRO JOURNAL 

5900 Cassandra Smith Rd. 
Hixson. TN 37343 

(615) 842-4600 

FAX (615) 842-4607 




46 Jin./Fe*. '90 



68 Micro Journal 



tr 



\=: 



!!! Subscribe Now !!! 



68 MICRO JOURNAL 

L X l /*"J Toll Free Subscription Line 1-800 669 6809 

OK. PLEASE ENTER MY SUBSCRIPTION 

Bill My: □ Mastercard [ZlviSA 
Card # Exp. Daie_ 



For I Year 



2 Years 



3 Years 



Enclosed: $_ 



Name 
Street 
City 



State 



Count ry_ 



My Computer is: 



My Operating System is: 



Toll Free Subscription Line 1-800 669 6809 
fr-t. Subscription Rates 

USA 
I Year $ 49.00, 2 years $ 79.00, 3 years $ 99.00 

Canada & Mexico, USA funds 

I Year $ 58.00. 2 Years $ 95.00, 3 Years $ 125.00 

Other Countries 

Surface Rales . USA funds 

1 Year $61.00, 2 Years $95.00. 3 Years $ 125.00 

Air Mail Rates, USA funds 
I Year $ 97.00. 2 Years $ 150.00. 3 Years $ 225.00 




*U.S. Currency Cash or Check Drawn on a USA Hank ! 

68* Micro Journal 

590* Cassandra Smith Rd. 
Hixson.TN 37343 

Toll Free Subscription Line 
1-800 669 6809 
JB?™» FAX (615) 842-4607 



, Zip 



=^\ 




=J) 



68 Micro Journal 



JsnJFeb. '90 



47 



SOFTWARE 



68000 C CROSS-COMPILER 

sim . SKOosMsoos.vu.xt.six tourer o.M.n 



. iKJRCloeoi 

eKiiele* 61010 craaja 



r. t«ra™ae»c««aat tw SKOC&.M or be enkfio) 



CROSS-ASSEMBLERS WITH MACRO CAPABILITIES 
r<u'w 110 fLKtJ>stJ>nirLHMsooi.iNixMiooi.tEKii mm *u.tm 



>. z» zm.jwj. imi. amis 6»ia. saw 

■umllVut lltOb 



Specify l» M07 MnilMMOl UD1 

J. tttnioiell 

CMOUEM TELECOMMUNICATIONS PROGRAM 
titttiiooiixnni.iiKnfLt.iourf.Mixx'Nirrs.x otjscr-oxi.r: ntcn >» 

McmnlrnCT wt» anneal oaaar. me miln, MOHW, XON XOFF.ck 

SUPER SLEUTH DISASSEMBLERS 

each m ru:x miosr ntt-vniri.r.x owmr-o.vi.r mc» jj»F»xir/>CT,coro 

■mere, im It jtrtw-mf wmfidM **> Wei*, uxlwk* uri, twMry c&uni 
Specif* roX»,t.7A^ l,«rttW£ *rn*j«i ih /SHnO.1 tcnaim 
COCO DOS itailaNe in MTO.I J.1.M.««W! nruos (em Win 5) only 
•MID i I lIM.KLKX.OSt.UHIFLKX.MSOOi.llMK.'-KBOS.XKMX 

UESHJtJCINC. SIMULATORS l-OR POPULAR 8-BIT CPUS 

«r» trS.eUi* iiaam tto.iisiruix vtie.CT.tnt.rt Vmu tstcovo rtt.x. viko osr 

hlcncu*cj)i MnwilaK pioceenon, include* dontf bly knw» l. binary cdotst 
Spec,', to 6JUVI. < 14)6801. BJOJ. «K» OS* ally. Z*0 HEX ,<u, 

ASSEMBLER CODE TRANSLATORS FOR 6502. 68*0/1. 680') 
uatuuat t7trlKt SAS-aSitto-vsirLtx 
until » not J mm in—i*d. tst-rijr.x tnsxf o*h ut-vsirLtx 

FDLI..SCKKKN SC BASIC PKHCKAMS wKn ...». oW 
AVAILABLE FOH PI. EX. UNIH.KX. AND MS DOS 



IN / tt* 
1 M SylKfll 



MO •ftceoTT. S25»« 

SIOO»AOBt». !»•« 

sioo.Aora. i»«« 

S100 w/aara. J50 • * 



disk anu xbasic utility pkockam libkaky 

tmritx unsimXrusoos 



PROFESSIONAL SERVICES 

k o ft T 14 k courtiTiNu Coummn 
CUSTOMIZED PROGRAMMING 

wtrdu 

(Ike cJmrrt lor i 



CONTRACT fROGRASIMIXG 



We wilt obs arv piya « onooa** a uMiP 1'M »« • ceontacl to**, i a 
enn^od In oaet namy yew ifco^»"»fli*U» wc h*vr perTuiBjHaicnTaTno pTofjajniieil 
»x lufc rem cuiuvj oodeh of oaunlnoncl. «n«ta« IBM tan>«lLll«^, Honey .c«.ausu 
popular mader* of miMcompwerf. uxhjdooj P*C IBM, DO. HP. AT*T, and rem pnredai 
bravon of aiicrocscnraltn, iiKladiAj 6H0M.6BOT. »0. 6301 68O1O. mini rem «n»n»>»« 
lantuejn and qmut dmi, on <yaea> ™nvn m sac (ran large etamnnKiUaa io 
unjJr Board coni/bttcnr m cnorrc lor oanrav {VcgraramuB) n onully by the Kouroroy cbctai* 

t'ONSMITIM; 

Wc offer i wide rente of tkoineo am* lotanicil cceonilu&B lervicex. tflcloa.no mnioare. eoVbce. 
cnuatn( and dcmia. go my ujpK Kleicd u comotocn; inc cfurfc for eonfctyfla) u aonrally 
bawd upon gaie, lnvrcf,oiki upeeaeo. 



Computer Systems Consultants Inc. 

MM Lam lane 
Cooyen. Goarfja W207 

i«aa)uM3X) • «M)au.|ii7 



Hnx tiwmi - t 



a -a irt* VBU aao otajm CUD o 



ADVANCED 32 BIT SINGLE BOARD COMPUTER 



20MHZ MC68030 

20MHZ 68881 

4-8 MBYTES RAM 

4 RS-232 SERIAL 
PORTS 

4 MBYTE/SEC SCSI 

32 BIT HIGH SPEED 
EXPANSION 

ON BOARD ETHER- 
NET 

REAL-TIME UNIX 
COMPATABLE OS 

$1,995 QTY 1 

The RAVEN™ SBC from 
Cogent Engineering repre- 
sents a new level of integra- 
tion and performance. Contained on a single 5.75" x 8.00" board 
are all of the functions needed for a complete 32 bit networking 
system. Compare the RAVEN to other single board solutions 
that offer less performance for more money and you'll see why 
the RAVEN is the right choice for all your embedded and multi- 
user requirements. Call or write: 
COGENT ENGINEERING 45 LAKESIDE AVE, #20 
MARLBORO, MA 01752 (800) 282-7642. (508) 624-6447 




RAVEN OPTIONS 



8 Mbyte upgrade . . .$395.00 

OS/9© $CALL 

UNIFLEX/RN© $495.00 

Development systems . ,$CALL 



48 



Jan./Feb. '90 



68 Mcro Journal 





mm 




Then lake a look at our range of 
quality VMEbus communications 
boards for the shop floor and the 
office. We can link systems using 
high-performance X.25, RS-232/422/ 
485 Arcnet and IBM Token Ring con- 
nections using wire or optical fiber. 

And we won't just sell a board and 
leave you to get on with it. 
Our support department will help 
you to handle any special-to-applica- 
tion problems. The result? A working 
system with the minimum hassle. 

Test our commitment to communi- 
cations. Make a start by asking for 
our Microsystems file. 




VME FUTURE8US+ 
OPEN ARCHITECTURE COMPUTERS 



comnmoLHc 

1S466UECa!DsBt«l 
Suite 109-365 
10SGATOS, 

CAl/ORNIA 95032 USA 
Phone:(1)-40B-356-3817 
Fa* : (11-408-356-1755 



COMWWITIWL SAW. 

146 Av ditriie 

75013 PWHS 

France 

Tel :(33)-(1)45.80.8448 

Fax: (33) -(1)45.80 .81 .63 



COMPCOWR0L GmbH 

YWheVroriVw Alee 259 

3500Kasset 

Germany 

HH '.(49)-(0)S61-35O06 

Fax: (49)-(0)561 -35007 



rxwcwrox a« 

Sbatwnse^K 31, 

Rtt Box 193 

5600 AD BMtoro. 

Hotend 

Tel :(l1)-(0)40-1249S5 

Fax: (31) -(0)40- 120296 




Ultrosclence DK/„ Gtobs Lobofotafes, Inc. 1824 Wilrnelte /We.. Wilmelte. IL USA tel. 312/2560080 fax 312/2&WD97